Installing uv from binary on Ubuntu

This commit is contained in:
Ivan Golikov 2025-01-10 14:55:44 +01:00
parent 522497cf33
commit a28d20bc38

View file

@ -10,15 +10,16 @@
- zoxide - zoxide
- git - git
- tldr - tldr
- uv
brew_packages: brew_packages:
- difftastic - difftastic
- fd - fd
- uv
pacman_packages: pacman_packages:
- difftastic - difftastic
- fd - fd
- uv
apt_packages: apt_packages:
- fd-find - fd-find
@ -72,6 +73,44 @@
pkg: "{{ common_packages }}" pkg: "{{ common_packages }}"
cache_valid_time: 3600 cache_valid_time: 3600
- name: Install uv (Ubuntu)
when: is_ubuntu
block:
- name: Create a temporary directory
ansible.builtin.tempfile:
state: directory
prefix: uv_temp_
register: temp_dir
- name: Download uv tarball
ansible.builtin.get_url:
url: "https://github.com/astral-sh/uv/releases/download/0.5.16/uv-x86_64-unknown-linux-gnu.tar.gz"
dest: "{{ temp_dir.path }}/uv.tar.gz"
- name: Unpack the tarball
ansible.builtin.unarchive:
src: "{{ temp_dir.path }}/uv.tar.gz"
dest: "{{ temp_dir.path }}"
remote_src: yes
- name: Ensure ~/.local/bin exists
ansible.builtin.file:
path: "{{ ansible_env.HOME }}/.local/bin"
state: directory
mode: '0755'
- name: Move unpacked files to ~/.local/bin
ansible.builtin.copy:
src: "{{ temp_dir.path }}/uv-x86_64-unknown-linux-gnu/"
dest: "{{ ansible_env.HOME }}/.local/bin/"
remote_src: yes
mode: '0755'
- name: Clean up temporary directory
ansible.builtin.file:
path: "{{ temp_dir.path }}"
state: absent
- name: Install uv packages - name: Install uv packages
ansible.builtin.command: "pipx tool install {{ item }}" ansible.builtin.command: "pipx tool install {{ item }}"
loop: "{{ uv_packages }}" loop: "{{ uv_packages }}"