--- - name: "Include OS-specific variables" ansible.builtin.include_vars: "{{ ansible_os_family | lower }}.yml" - name: "Install uv" community.general.homebrew: name: "uv" state: "present" - name: "Add uv to shell profile" ansible.builtin.blockinfile: path: "{{ ansible_env.HOME }}/.bashrc" state: "present" prepend_newline: true append_newline: true marker: "# ==== {mark} ANSIBLE UV PYTHON CONFIG" block: | if command -v uv 1>/dev/null 2>&1; then export PATH="$HOME/.local/bin:$PATH" fi - name: "Install python versions" ansible.builtin.command: cmd: "uv python install {{ item }}" args: creates: "{{ ansible_env.HOME }}/.local/share/uv/python/cpython-{{ item }}*/bin/python{{ item }}" environment: PATH: "/home/linuxbrew/.linuxbrew/bin:{{ ansible_env.PATH }}" loop: "{{ python_versions }}" when: python_versions | length > 0