From 806deb655dc2cce32ceffde65ebb7abe88937da1 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Mon, 20 Oct 2025 00:06:49 +0200 Subject: Refactor python role to remove homebrew dependency --- roles/ansible/README.md | 26 +++----------------------- roles/ansible/tasks/main.yml | 8 -------- 2 files changed, 3 insertions(+), 31 deletions(-) (limited to 'roles/ansible') diff --git a/roles/ansible/README.md b/roles/ansible/README.md index 8e6f3a6e..1234be86 100644 --- a/roles/ansible/README.md +++ b/roles/ansible/README.md @@ -60,32 +60,12 @@ To switch the default version: The symlinks will be updated to point to the new default versions. -## Manual Cleanup - -This role does not automatically remove unused versions. To manually clean up old installations: - -### List installed versions - -```bash -pipx list --short -``` - -### Remove specific versions - -```bash -# Remove ansible-core versions -pipx uninstall ansible-core2.18.0 - -# Remove molecule versions -pipx uninstall molecule25.7.0 -``` - ## Requirements -- pipx must be installed and available at `/home/linuxbrew/.linuxbrew/bin/pipx` -- The `community.general` Ansible collection for the pipx module +- `uv` +- `python` -These requirements are satisfied with the `homebrew` and `python` roles (added as dependencies) +These are installed via `python` role ## Example Playbook diff --git a/roles/ansible/tasks/main.yml b/roles/ansible/tasks/main.yml index fa1de1b7..335dba72 100644 --- a/roles/ansible/tasks/main.yml +++ b/roles/ansible/tasks/main.yml @@ -12,8 +12,6 @@ uv tool list | grep "^ansible-core " | awk '{print $2}' | sed 's/^v//' args: executable: /bin/bash - environment: - PATH: "/home/linuxbrew/.linuxbrew/bin:{{ ansible_env.PATH }}" register: ansible_core_installed_version changed_when: false failed_when: false @@ -24,8 +22,6 @@ uv tool install ansible-core=={{ ansible_core_version }} --force args: executable: /bin/bash - environment: - PATH: "/home/linuxbrew/.linuxbrew/bin:{{ ansible_env.PATH }}" changed_when: true when: ansible_core_installed_version.stdout != ansible_core_version @@ -35,8 +31,6 @@ uv tool list | grep "^molecule " | awk '{print $2}' | sed 's/^v//' args: executable: /bin/bash - environment: - PATH: "/home/linuxbrew/.linuxbrew/bin:{{ ansible_env.PATH }}" register: molecule_installed_version changed_when: false failed_when: false @@ -47,7 +41,5 @@ uv tool install molecule=={{ molecule_version }} --with 'molecule-plugins[docker,podman]' --force args: executable: /bin/bash - environment: - PATH: "/home/linuxbrew/.linuxbrew/bin:{{ ansible_env.PATH }}" changed_when: true when: molecule_installed_version.stdout != molecule_version -- cgit v1.2.3