refactor ♻️: Refactored the setup process to install necessary Python packages using Ansible.
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user