blob: e8904d2d09bf13445098b9e3b54dda0ce1b6a730 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
---
- 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 }}"
with_items: "{{ python_versions }}"
when: python_versions | length > 0
|