- Debian: 10 through latest
- RHEL: 9 through latest
- Ubuntu: Use the Debian-family play
- name: Install Python stack on Debian family
hosts: python_debian
become: true
tasks:
- name: Install Python packages
ansible.builtin.apt:
update_cache: true
name:
- python3
- python3-pip
- python3-venv
- pipx
state: present
- name: Ensure pipx path is configured system-wide
ansible.builtin.lineinfile:
path: /etc/profile.d/pipx.sh
create: true
line: 'export PATH="$PATH:/root/.local/bin"'
- name: Install Python stack on RHEL family
hosts: python_rhel
become: true
tasks:
- name: Install Python packages
ansible.builtin.dnf:
name:
- python3
- python3-pip
state: present
- Add Ubuntu hosts to
python_debian.