Skip to content

Install 'cryptography' using 'pip' Instead of Using System's Package Manager #596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
19 changes: 19 additions & 0 deletions tasks/plus/install-pip2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- name: (Python 2) Get version 2.7 'pip' script
ansible.builtin.get_url:
url: "https://bootstrap.pypa.io/pip/2.7/get-pip.py"
dest: "/tmp/get-pip.py"
mode: "0755"

- name: (Python 2) Check if 'pip' binary exists
ansible.builtin.stat:
path: /usr/bin/pip
ignore_errors: true
register: pip

- name: (Python 2) Install 'pip' version 2.7
ansible.builtin.command: "python get-pip.py"
args:
chdir: /tmp/
when: not pip.stat.exists
register: pip_install
changed_when: pip_install.changed
7 changes: 7 additions & 0 deletions tasks/plus/install-pip3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- name: (Python 3) Install 'pip' package
ansible.builtin.package:
name: python3-pip

- name: (Python 3) Ensure 'pip' is updated
ansible.builtin.pip:
name: pip>=21.2.4
7 changes: 5 additions & 2 deletions tasks/plus/setup-license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
- name: (Debian/Red Hat/SLES OSs) Set up NGINX Plus license
when: ansible_facts['os_family'] != 'Alpine'
block:
- name: (RedHat) Install pip
ansible.builtin.include_tasks: "{{ role_path }}/tasks/plus/install-pip{{ ansible_python['version']['major'] }}.yml"

- name: (Debian/Red Hat/SLES OSs) Create SSL directory
ansible.builtin.file:
path: /etc/ssl/nginx
Expand All @@ -64,8 +67,8 @@
- "{{ nginx_license['key'] }}"

- name: (Debian/Red Hat/SLES OSs) Install cryptography package
ansible.builtin.package:
name: "{{ (ansible_python['version']['major'] == 3) | ternary('python3-cryptography', 'python2-cryptography') }}"
ansible.builtin.pip:
name: cryptography
when: not (ansible_facts['distribution'] == "OracleLinux" and ansible_facts['distribution_major_version'] == "8")

- name: (OracleLinux 8) Install cryptography package
Expand Down
Loading