From 7699e7f435eb6a0943755ac4fb72321986c6b57f Mon Sep 17 00:00:00 2001 From: Jose Date: Wed, 22 Oct 2025 17:33:41 +0200 Subject: [PATCH] =?UTF-8?q?refactor=20=E2=99=BB=EF=B8=8F:=20Refactored=20t?= =?UTF-8?q?he=20setup=20process=20to=20install=20necessary=20Python=20pack?= =?UTF-8?q?ages=20using=20Ansible.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated the tasks in `setupacdc.yml` to include installing `python3-pip`, `proxmoxer`, and `requests` libraries on the control node. This refactoring ensures that all required dependencies are managed centrally, improving maintainability and consistency. --- tasks/setupacdc.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tasks/setupacdc.yml b/tasks/setupacdc.yml index 9a0dea9..99fee3e 100644 --- a/tasks/setupacdc.yml +++ b/tasks/setupacdc.yml @@ -5,6 +5,16 @@ mac_address: "8E:90:31:DE:31:36" tasks: + - name: Install python3-pip package + ansible.builtin.package: + # Use the appropriate package name based on the distribution + name: "{{ __pip_package_name }}" + state: present + vars: + __pip_package_name: "{% if ansible_os_family == 'Debian' %}python3-pip{% elif ansible_os_family == 'RedHat' %}python3-pip{% elif ansible_os_family == 'Suse' %}python3-pip{% else %}python3-pip{% endif %}" + # Ensure the package manager cache is updated before installation, especially on Debian/Ubuntu + when: ansible_os_family in ['Debian', 'RedHat', 'Suse'] + - name: Install 'proxmoxer' and 'requests' Python libraries on the control node ansible.builtin.pip: # List both libraries here