system-config/playbooks/roles/pip3/tasks/main.yaml
Guillaume Chauvel 0867988745 Install get-pip.py for python3.5/xenial with specific url
The get-pip script does not work well with python3.5/xenial
It raises error during installation [1].
Use python3.5 specific url to install working version.

[1] https://github.com/pypa/get-pip/issues/83

Change-Id: Iea35d9df1ea5f2b8ea5e5d29b4c79e97c99848a1
2021-01-25 19:49:02 +01:00

42 lines
985 B
YAML

- name: Remove pip and virtualenv packages
package:
name:
- python3-pip
- python3-virtualenv
state: absent
# NOTE(ianw) : See https://github.com/pypa/get-pip/issues/43;
# requirement of get-pip.py
# Xenial doesn't have python3-distutils as it appears to be part
# of python3 itself.
- name: Ensure distutils
package:
name:
- python3-distutils
state: present
when: ansible_distribution_release != 'xenial'
- name: Download OS/Python specific get-pip.py
include_tasks: "{{ get_pip_os }}"
with_first_found:
- "{{ ansible_distribution_release }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
- "default.yaml"
loop_control:
loop_var: get_pip_os
- name: Install pip
command: python3 /var/lib/get-pip.py
args:
creates: /usr/local/bin/pip3
- name: Install latest pip and virtualenv
pip:
name: "{{ item }}"
state: latest
executable: pip3
loop:
- pip
- virtualenv