]> git.phdru.name Git - ansible.git/blob - playbooks/roles/python-packages/tasks/main.yml
Feat: Improve task names
[ansible.git] / playbooks / roles / python-packages / tasks / main.yml
1 - name: Install Python and packages (Debian)
2   become: true
3   apt:
4     autoclean: yes
5     autoremove: yes
6     cache_valid_time: 3600
7     install_recommends: no
8     name: ['python', 'python2.7', 'python3', 'python-pip', 'python3-pip',
9            'python-setuptools', 'python3-setuptools',
10            'python-gdbm', 'python-openssl', 'python3-openssl',
11           ]
12     state: latest
13     update_cache: yes
14   register: python
15   when: ansible_facts.os_family == 'Debian'
16
17 - name: Install Python and packages (RedHat)
18   become: true
19   dnf:
20     name: ['python2', 'python3', 'python2-pip', 'python3-pip',
21            'python2-setuptools', 'python3-setuptools',
22            'python2-pyOpenSSL', 'python3-pyOpenSSL',
23           ]
24     state: latest
25     update_cache: yes
26   register: python
27   when: ansible_facts.os_family == 'RedHat'
28
29 - name: Upgrade Python packages
30   become: true
31   shell: 'umask 022; {{ item }} -m pip install --upgrade
32       "pip < 19.1" setuptools tox virtualenv virtualenvwrapper "wheel < 0.31.1"
33       flake8 sphinx twine'
34   when: python.changed
35   loop: ['python3', 'python2']