From 086798874583619dabffe0a6348d04b1a2523a62 Mon Sep 17 00:00:00 2001 From: Guillaume Chauvel Date: Mon, 25 Jan 2021 18:03:10 +0100 Subject: [PATCH] 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 --- playbooks/roles/pip3/tasks/default.yaml | 5 +++++ playbooks/roles/pip3/tasks/main.yaml | 14 +++++++++----- playbooks/roles/pip3/tasks/xenial.yaml | 6 ++++++ 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 playbooks/roles/pip3/tasks/default.yaml create mode 100644 playbooks/roles/pip3/tasks/xenial.yaml diff --git a/playbooks/roles/pip3/tasks/default.yaml b/playbooks/roles/pip3/tasks/default.yaml new file mode 100644 index 0000000000..e58d05ae4e --- /dev/null +++ b/playbooks/roles/pip3/tasks/default.yaml @@ -0,0 +1,5 @@ +- name: Download get-pip.py + command: wget https://bootstrap.pypa.io/get-pip.py + args: + chdir: /var/lib + creates: /var/lib/get-pip.py diff --git a/playbooks/roles/pip3/tasks/main.yaml b/playbooks/roles/pip3/tasks/main.yaml index 2ad311161a..091e3e60fa 100644 --- a/playbooks/roles/pip3/tasks/main.yaml +++ b/playbooks/roles/pip3/tasks/main.yaml @@ -16,11 +16,15 @@ 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: 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 diff --git a/playbooks/roles/pip3/tasks/xenial.yaml b/playbooks/roles/pip3/tasks/xenial.yaml new file mode 100644 index 0000000000..734fa5d6d1 --- /dev/null +++ b/playbooks/roles/pip3/tasks/xenial.yaml @@ -0,0 +1,6 @@ +# https://github.com/pypa/get-pip/issues/83 +- name: Download get-pip.py + command: wget https://bootstrap.pypa.io/3.5/get-pip.py + args: + chdir: /var/lib + creates: /var/lib/get-pip.py