diff --git a/ansible/README.md b/ansible/README.md index b9cda4f..0993c98 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -1,24 +1,6 @@ # Ansible -## Can be installed with apt: -- bash (already done) -- docker (done) -- entr -- fd (fd-find) -- firefox (has to add repository to apt) -- fzf -- gh -- git (already installed) -- go (manual install) -- goreleaser (has to add repository to apt) -- helm (has to add repository to apt) -- htop -- jq -- k9s (not possible right off the bat) -- karabiner (not needed on debian) - - ## Install Ansible Check the Python interpreter path to verify if the target Ansible interpreter @@ -51,6 +33,9 @@ The playbook will run all the specified roles in the `setup.yaml` file. It's possible to use `--tags` and `--limit` to narrow down the scope of planned changes to apply. +In case the OS needs super user privileges, add the `--ask-become-pass` to be +prompted for one. + ## Test Ansible roles in the setup playbook diff --git a/ansible/roles/uv/tasks/main.yaml b/ansible/roles/uv/tasks/main.yaml new file mode 100644 index 0000000..cb48fcf --- /dev/null +++ b/ansible/roles/uv/tasks/main.yaml @@ -0,0 +1,35 @@ +--- +- name: Install Uv + tags: + - uv + block: + - name: Create temporary directory for the Uv archive + ansible.builtin.tempfile: + state: directory + register: uv_source_temp_dir + changed_when: false + + - name: Extract Uv release source files + become: true + ansible.builtin.unarchive: + src: "{{ uv_release_source_url }}" + dest: "{{ uv_source_temp_dir.path }}" + remote_src: true + changed_when: false + + - name: Copy the Uv binary to the destination catalog + become: true + ansible.builtin.copy: + src: "{{ uv_source_temp_dir.path }}/{{ ansible_os_family | extract(uv_os_family_release) }}/{{ item }}" + dest: "{{ uv_binary_dest_dir }}/{{ item }}" + mode: u=+rwx,g=+rx-x,o=+rx-w + remote_src: true + with_items: "{{ uv_binaries_to_copy }}" + + - name: Ensure the temporary directory for Uv sources files is removed + ansible.builtin.file: + path: "{{ uv_source_temp_dir.path }}" + state: absent + when: uv_source_temp_dir is defined + changed_when: false +... diff --git a/ansible/roles/uv/vars/main/main.yaml b/ansible/roles/uv/vars/main/main.yaml new file mode 100644 index 0000000..5a528f3 --- /dev/null +++ b/ansible/roles/uv/vars/main/main.yaml @@ -0,0 +1,10 @@ +uv_release_version: "0.8.11" +uv_os_family_release: { + "Darwin": "uv-x86_64-apple-darwin", + "Debian": "uv-i686-unknown-linux-gnu", +} +uv_release_source_url: "https://github.com/astral-sh/uv/releases/download/{{ uv_release_version }}/{{ ansible_os_family | extract(uv_os_family_release) }}.tar.gz" +uv_binary_dest_dir: "/usr/local/bin" +uv_binaries_to_copy: + - "uv" + - "uvx" diff --git a/ansible/setup.yaml b/ansible/setup.yaml index 8da208d..bd1c11f 100644 --- a/ansible/setup.yaml +++ b/ansible/setup.yaml @@ -39,4 +39,5 @@ - wezterm - firefox - karabiner + - uv ...