From 7c86c4d0677dda0431114606b295df90d8607337 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Thu, 24 Oct 2019 08:33:59 +0900 Subject: [PATCH] Update pip3 role to install from get-pip.py Our base images have pip pre-installed from get-pip. This means that the installation of pip and virtualenv from distro packages in the ansible is misleading. Update the role to match reality. Change-Id: I500b14f9f9df00b6e0c4f152f8b4c7faa1bb94d4 --- playbooks/roles/pip3/tasks/main.yaml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/playbooks/roles/pip3/tasks/main.yaml b/playbooks/roles/pip3/tasks/main.yaml index 9798bedccd..9845036d2a 100644 --- a/playbooks/roles/pip3/tasks/main.yaml +++ b/playbooks/roles/pip3/tasks/main.yaml @@ -1,6 +1,26 @@ -- name: Install pip and virtualenv +- name: Remove pip and virtualenv packages package: name: - python3-pip - python3-virtualenv - state: present + state: absent + +- 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