-- name: Install Python and packages
+- name: Install Python and packages (Debian)
become: true
apt:
autoclean: yes
register: python
when: ansible_facts.os_family == 'Debian'
-- name: Install Python and packages
+- name: Install Python and packages (RedHat)
become: true
dnf:
name: ['python2', 'python3', 'python2-pip', 'python3-pip',
- name: Upgrade Python packages
become: true
- shell: 'umask 022; {{ item }} -m pip install --upgrade
+ shell: 'umask 022; exec {{ item }} -m pip install --compile --upgrade
"pip < 19.1" setuptools tox virtualenv virtualenvwrapper "wheel < 0.31.1"
flake8 sphinx twine'
when: python.changed