|
13 | 13 | state: latest # noqa package-latest
|
14 | 14 | when: ansible_facts['os_family'] == "Debian"
|
15 | 15 |
|
| 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 | + |
16 | 23 | - name: (Amazon Linux) Set up Amazon Linux Extras repositories
|
17 | 24 | ansible.builtin.command: amazon-linux-extras enable {{ item }}
|
18 | 25 | changed_when: false
|
19 | 26 | loop: "{{ nginx_app_protect_amazon_extras }}"
|
20 | 27 | when: ansible_facts['distribution'] == "Amazon"
|
21 | 28 |
|
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" |
24 | 39 | block:
|
25 |
| - - name: (Amazon Linux/RHEL) Import EPEL GPG key |
| 40 | + - name: (RHEL) Import EPEL GPG key |
26 | 41 | ansible.builtin.rpm_key:
|
27 | 42 | 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'] }} |
29 | 44 |
|
30 |
| - - name: (Amazon Linux/RHEL) Install package dependencies |
| 45 | + - name: (RHEL) Install package dependencies |
31 | 46 | 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 |
33 | 48 | update_cache: true
|
34 | 49 | state: latest # noqa package-latest
|
35 | 50 |
|
|
0 commit comments