Skip to content

Commit

Permalink
Add workaround to install pip2 on CentOS 7
Browse files Browse the repository at this point in the history
This installs pip for Python 2 using the get-pip script rather
than the repository package, since the repository pip version
is too old to talk to Pypi to upgrade itself to a newer version.

(related to YDA-5832)
  • Loading branch information
stsnel committed Jul 24, 2024
1 parent 7b33598 commit 0c727c2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 21 deletions.
8 changes: 0 additions & 8 deletions roles/irods_icat/tasks/setup_pam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@
when: external_users


- name: Ensure Python dependencies are installed
ansible.builtin.package:
name:
- python-pip
state: present
when: enable_tokens


# When data access tokens are enabled, pysqlcipher3 needs to be
# installed globally too for the token authentication script
# (in addition to the user-level installation for the ruleset).
Expand Down
22 changes: 16 additions & 6 deletions roles/python_irodsclient/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
---
# copyright Utrecht University

- name: Ensure Python dependencies are installed
ansible.builtin.package:
name:
- python-pip
state: present
- name: Download get-pip script for Python 2.7
ansible.builtin.get_url:
url: 'https://bootstrap.pypa.io/pip/2.7/get-pip.py'
dest: '/usr/local/bin/get-pip.py'
checksum: 'sha256:40ee07eac6674b8d60fce2bbabc148cf0e2f1408c167683f110fd608b8d6f416'
mode: '0755'


# The packaged pip2 version on CentOS 7 is so ancient that it can't talk
# to pypi anymore, so we need to use the get-pip script to be able to
# bootstrap pip for Python 2
- name: Install pip for Python 2.7
become: true
ansible.builtin.command:
cmd: /usr/bin/python2.7 /usr/local/bin/get-pip.py --prefix /usr
creates: /usr/local/bin/pip2


- name: Ensure python-irodsclient dependencies are installed
ansible.builtin.pip:
name:
- pip==20.2.4
- setuptools==44.1.1
state: present

Expand Down
1 change: 0 additions & 1 deletion roles/yoda_rulesets/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
- name: Ensure Python dependencies are installed
ansible.builtin.package:
name:
- python-pip
- gcc
state: present

Expand Down
6 changes: 0 additions & 6 deletions roles/yoda_test_users_eus/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@
changed_when: false


- name: Ensure Python pip is installed
ansible.builtin.package:
name: python-pip
state: present


- name: Install passlib and dependencies
ansible.builtin.pip:
name:
Expand Down

0 comments on commit 0c727c2

Please sign in to comment.