Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions ansible/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand Down
35 changes: 35 additions & 0 deletions ansible/roles/uv/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -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
...
10 changes: 10 additions & 0 deletions ansible/roles/uv/vars/main/main.yaml
Original file line number Diff line number Diff line change
@@ -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"
1 change: 1 addition & 0 deletions ansible/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@
- wezterm
- firefox
- karabiner
- uv
...