Skip to content
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

fix: EPEL is no longer active on RHEL 7 based distros #310

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions tasks/common/prerequisites/install-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,38 @@
state: latest # noqa package-latest
when: ansible_facts['os_family'] == "Debian"

- name: (Amazon Linux/RHEL) Install package dependencies
ansible.builtin.yum:
name: "{{ nginx_app_protect_redhat_dependencies }}"
update_cache: true
state: latest # noqa package-latest
when: ansible_facts['os_family'] == "RedHat"

- name: (Amazon Linux) Set up Amazon Linux Extras repositories
ansible.builtin.command: amazon-linux-extras enable {{ item }}
changed_when: false
loop: "{{ nginx_app_protect_amazon_extras }}"
when: ansible_facts['distribution'] == "Amazon"

- name: (Amazon Linux/RHEL) Install package dependencies
when: ansible_facts['os_family'] == "RedHat"
- name: (Amazon Linux) Install EPEL
ansible.builtin.command:
cmd: amazon-linux-extras install -y epel
creates: /etc/yum.repos.d/epel.repo
when: ansible_facts['distribution'] == "Amazon"

- name: (RHEL) Install EPEL
when:
- ansible_facts['os_family'] == "RedHat"
- ansible_facts['distribution'] != "Amazon"
block:
- name: (Amazon Linux/RHEL) Import EPEL GPG key
- name: (RHEL) Import EPEL GPG key
ansible.builtin.rpm_key:
state: present
key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ (ansible_facts['distribution'] == 'Amazon') | ternary('7', ansible_facts['distribution_major_version']) }}
key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_facts['distribution_major_version'] }}

- name: (Amazon Linux/RHEL) Install package dependencies
- name: (RHEL) Install package dependencies
ansible.builtin.yum:
name: "{{ nginx_app_protect_redhat_dependencies }}"
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_facts['distribution_major_version'] }}.noarch.rpm
update_cache: true
state: latest # noqa package-latest

Expand Down
2 changes: 1 addition & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ nginx_app_protect_amazon_extras: [selinux-ng]
nginx_app_protect_debian_dependencies: [apt-transport-https, ca-certificates]

# Red Hat dependencies
nginx_app_protect_redhat_dependencies: [ca-certificates, "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ((ansible_facts['distribution'] == 'Amazon') | ternary('7', ansible_facts['distribution_major_version'])) }}.noarch.rpm"]
nginx_app_protect_redhat_dependencies: [ca-certificates]

# Choose where to fetch the NGINX App Protect and Security Updates signing keys from.
# Default settings are the official NGINX signing key hosts.
Expand Down
Loading