Clean up the uv installs this role used to make

It managed them, it no longer needs them, and a stray uv on PATH is a confusing
thing to find when working out how the venv got built. Nothing else on these
hosts put them there.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-19 21:29:18 +02:00
parent 9bd23467f0
commit 1b5a5e2c1d

View File

@@ -41,6 +41,24 @@
buried.
when: not ansible_check_mode and not pi_musicmouse_pyproject.stat.exists
- name: Find leftover uv installs
# This role used to install uv here to get a Python the distribution does not ship.
# It manages neither any more, and a stray uv on PATH is a confusing thing to find
# when debugging the venv, so take them back out. Nothing else put them there.
ansible.builtin.find:
paths: /opt
patterns: "uv-*"
file_type: directory
register: pi_musicmouse_stale_uv
- name: Remove leftover uv installs
ansible.builtin.file:
path: "{{ item }}"
state: absent
loop: >-
{{ (pi_musicmouse_stale_uv.files | map(attribute='path') | list)
+ ['/usr/local/bin/uv', '/usr/local/bin/uvx'] }}
- name: Get the system Python version
ansible.builtin.command:
cmd: python3 -c "import sys; print('%d.%d' % sys.version_info[:2])"