Skip to content

Commit 800b8e1

Browse files
authored
fix: EPEL is no longer active on RHEL 7 based distros (#310)
1 parent c65659a commit 800b8e1

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

tasks/common/prerequisites/install-dependencies.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,38 @@
1313
state: latest # noqa package-latest
1414
when: ansible_facts['os_family'] == "Debian"
1515

16+
- name: (Amazon Linux/RHEL) Install package dependencies
17+
ansible.builtin.yum:
18+
name: "{{ nginx_app_protect_redhat_dependencies }}"
19+
update_cache: true
20+
state: latest # noqa package-latest
21+
when: ansible_facts['os_family'] == "RedHat"
22+
1623
- name: (Amazon Linux) Set up Amazon Linux Extras repositories
1724
ansible.builtin.command: amazon-linux-extras enable {{ item }}
1825
changed_when: false
1926
loop: "{{ nginx_app_protect_amazon_extras }}"
2027
when: ansible_facts['distribution'] == "Amazon"
2128

22-
- name: (Amazon Linux/RHEL) Install package dependencies
23-
when: ansible_facts['os_family'] == "RedHat"
29+
- name: (Amazon Linux) Install EPEL
30+
ansible.builtin.command:
31+
cmd: amazon-linux-extras install -y epel
32+
creates: /etc/yum.repos.d/epel.repo
33+
when: ansible_facts['distribution'] == "Amazon"
34+
35+
- name: (RHEL) Install EPEL
36+
when:
37+
- ansible_facts['os_family'] == "RedHat"
38+
- ansible_facts['distribution'] != "Amazon"
2439
block:
25-
- name: (Amazon Linux/RHEL) Import EPEL GPG key
40+
- name: (RHEL) Import EPEL GPG key
2641
ansible.builtin.rpm_key:
2742
state: present
28-
key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ (ansible_facts['distribution'] == 'Amazon') | ternary('7', ansible_facts['distribution_major_version']) }}
43+
key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_facts['distribution_major_version'] }}
2944

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

vars/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ nginx_app_protect_amazon_extras: [selinux-ng]
7474
nginx_app_protect_debian_dependencies: [apt-transport-https, ca-certificates]
7575

7676
# Red Hat dependencies
77-
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"]
77+
nginx_app_protect_redhat_dependencies: [ca-certificates]
7878

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

0 commit comments

Comments
 (0)