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