diff --git a/bin/actions/update.py b/bin/actions/update.py index 82b4ad1..3e8fd84 100755 --- a/bin/actions/update.py +++ b/bin/actions/update.py @@ -66,9 +66,7 @@ def ensure_ansible_collections(): if len(parts) >= 1: collection_name = parts[0] installed_collections.append(collection_name) - - printfe("cyan", f"Found installed collections: {', '.join(installed_collections) if installed_collections else 'none'}") - + # Check which required collections are missing missing_collections = [] for collection in required_collections: @@ -166,16 +164,7 @@ def main(): dotfiles_path = os.environ.get("DOTFILES_PATH", os.path.expanduser("~/.dotfiles")) hostname = os.uname().nodename username = os.environ.get("USER", os.environ.get("USERNAME", "user")) - - # Check if ansible is installed - status, _ = run_command(["which", "ansible-playbook"], shell=False) - if not status: - printfe("yellow", "Ansible is not installed, installing it with pipx...") - status, output = run_command(["pipx", "install", "--include-deps", "ansible", "ansible-lint"], shell=False) - if not status: - printfe("red", f"Failed to install Ansible: {output}") - return 1 - + # Ensure required collections are installed if not ensure_ansible_collections(): printfe("red", "Failed to ensure required Ansible collections are installed") diff --git a/config/ansible/tasks/global/pipx.yml b/config/ansible/tasks/global/pipx.yml deleted file mode 100644 index 75682e1..0000000 --- a/config/ansible/tasks/global/pipx.yml +++ /dev/null @@ -1,24 +0,0 @@ -- name: List installed pipx packages - ansible.builtin.shell: set -o pipefail && pipx list --short | awk '{print $1}' - args: - executable: /bin/bash - register: installed_pipx_packages - changed_when: false - -- name: Define desired pipx packages - ansible.builtin.set_fact: - desired_pipx_packages: - - shyaml - -- name: Install/Upgrade pipx packages - community.general.pipx: - name: "{{ item }}" - state: present - force: true - loop: "{{ desired_pipx_packages }}" - -- name: Remove undesired pipx packages - community.general.pipx: - name: "{{ item }}" - state: absent - loop: "{{ installed_pipx_packages.stdout_lines | difference(desired_pipx_packages) }}"