From 1b5a5e2c1d90298ea12724b76062e99f5098def3 Mon Sep 17 00:00:00 2001 From: Martin Bauer Date: Sat, 19 Sep 2026 21:29:18 +0200 Subject: [PATCH] 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 --- roles/pi_musicmouse/tasks/main.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/roles/pi_musicmouse/tasks/main.yml b/roles/pi_musicmouse/tasks/main.yml index f945027..3c48707 100644 --- a/roles/pi_musicmouse/tasks/main.yml +++ b/roles/pi_musicmouse/tasks/main.yml @@ -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])"