system-config/playbooks/roles/pip3/tasks/main.yaml
Clark Boylan 02a81a5c7f Install pip3 for docker-compose installation
We need newer docker-compose for functionality like stop_grace_period
and the easiest way to get that is via pypi. To install from there we
need pip.

This also fixes pip3 to work on xenial which doesn't have a
python3-distutils package.

Change-Id: I5f5431cac7eb191f2f5443892292ca5a236fe1e6
2020-04-17 13:28:03 -07:00

38 lines
837 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 get-pip.py
command: wget https://bootstrap.pypa.io/get-pip.py
args:
chdir: /var/lib
creates: /var/lib/get-pip.py
- 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