From 5430f814c62612f0693ad69e1b67c841febd9c8c Mon Sep 17 00:00:00 2001 From: Ahmed AbdelHalim Date: Mon, 20 Oct 2025 01:55:06 +0200 Subject: Implement a better download/install for python, pihole and go role --- roles/python/tasks/main.yml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'roles/python') diff --git a/roles/python/tasks/main.yml b/roles/python/tasks/main.yml index 55f4e34a..ddecbbbb 100644 --- a/roles/python/tasks/main.yml +++ b/roles/python/tasks/main.yml @@ -2,17 +2,24 @@ - name: "Include OS-specific variables" ansible.builtin.include_vars: "{{ ansible_os_family | lower }}.yml" +- name: "Check if uv binary exists" + ansible.builtin.stat: + path: "{{ ansible_env.HOME }}/.local/bin/uv" + register: python_uv_binary + - name: "Download uv installer" ansible.builtin.get_url: url: "https://astral.sh/uv/install.sh" dest: "/tmp/install_uv.sh" mode: "0755" + when: not python_uv_binary.stat.exists - name: "Run uv installer" ansible.builtin.command: cmd: "/tmp/install_uv.sh" args: creates: "{{ ansible_env.HOME }}/.local/bin/uv" + when: not python_uv_binary.stat.exists - name: "Add uv to shell profile" ansible.builtin.blockinfile: -- cgit v1.2.3