|
7 | 7 | - '"geoip" in nginx_modules'
|
8 | 8 | - nginx_install_epel_release | bool
|
9 | 9 |
|
10 |
| -- name: (RHEL 7) Install GeoIP2 dependency |
| 10 | +- name: (Amazon Linux 2/RHEL 7) Install GeoIP2 dependency |
11 | 11 | when:
|
12 |
| - - ansible_facts['distribution'] == "RedHat" |
13 |
| - - ansible_facts['distribution_major_version'] is version('7', '==') |
| 12 | + - (ansible_facts['distribution'] == "RedHat" and ansible_facts['distribution_major_version'] is version('7', '==')) |
| 13 | + or ansible_facts['distribution'] == "Amazon" |
14 | 14 | - '"geoip2" in nginx_modules'
|
15 | 15 | block:
|
16 |
| - - name: (RHEL 7) Check if libmaxminddb is available |
| 16 | + - name: (Amazon Linux 2/RHEL 7) Check if libmaxminddb is available |
17 | 17 | ansible.builtin.yum:
|
18 | 18 | list: available
|
19 | 19 | register: packages
|
20 | 20 |
|
21 |
| - - name: (RHEL 7) Install libmaxminddb |
| 21 | + - name: (Amazon Linux 2/RHEL 7) Install libmaxminddb |
22 | 22 | ansible.builtin.yum:
|
23 | 23 | name: https://rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/libmaxminddb-1.2.0-6.el7.x86_64.rpm
|
24 | 24 | when: '"libmaxminddb" not in packages.results'
|
25 | 25 |
|
26 |
| -- name: (AlmaLinux/Oracle Linux/RHEL) Install GeoIP2 and/or OpenTracing EPEL dependency |
| 26 | +- name: (AlmaLinux/Amazon Linux 2/Oracle Linux/RHEL/Rocky Linux) Install GeoIP2 and/or OpenTracing EPEL dependency |
27 | 27 | when:
|
28 |
| - - ansible_facts['os_family'] == "RedHat" and ansible_facts['distribution'] != "Amazon" |
29 |
| - - (ansible_facts['distribution_major_version'] is version('7', '==') and '"geoip2" in nginx_modules') |
30 |
| - or '"opentracing" in nginx_modules' |
| 28 | + - ansible_facts['os_family'] == "RedHat" |
| 29 | + - ('"opentracing" in nginx_modules') |
31 | 30 | - nginx_install_epel_release | bool
|
32 | 31 | block:
|
33 |
| - - name: (RHEL) Import EPEL GPG key |
| 32 | + - name: (AlmaLinux/Amazon Linux 2/Oracle Linux/RHEL/Rocky Linux) Import EPEL GPG key |
34 | 33 | ansible.builtin.rpm_key:
|
35 | 34 | state: present
|
36 |
| - key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_facts['distribution_major_version'] }} |
| 35 | + key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ((ansible_facts['distribution'] == 'Amazon') | ternary('7', ansible_facts['distribution_major_version'])) }} |
37 | 36 |
|
38 |
| - - name: (RHEL) Install EPEL |
| 37 | + - name: (AlmaLinux/Amazon Linux 2/Oracle Linux/RHEL/Rocky Linux) Install EPEL |
39 | 38 | ansible.builtin.yum:
|
40 |
| - name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_facts['distribution_major_version'] }}.noarch.rpm |
| 39 | + name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ((ansible_facts['distribution'] == 'Amazon') | ternary('7', ansible_facts['distribution_major_version'])) }}.noarch.rpm |
41 | 40 |
|
42 | 41 | - name: (Alpine Linux) Install Lua and Encrypted Sessions Alpine Linux 3.17 dependency
|
43 | 42 | community.general.apk:
|
|
46 | 45 | - nginx_type == 'plus'
|
47 | 46 | - ansible_facts['os_family'] == "Alpine"
|
48 | 47 | - ansible_facts['distribution_version'] | regex_search('^[0-9]+\\.[0-9]+') is version('3.17', '==')
|
49 |
| - - ('"lua" in nginx_modules') or ('"encrypted-sessions" in nginx_modules') |
| 48 | + - ('"encrypted-sessions" in nginx_modules') or ('"lua" in nginx_modules') or ('"set-misc" in nginx_modules') |
50 | 49 |
|
51 | 50 | - name: Setup NGINX modules
|
52 | 51 | ansible.builtin.package:
|
|
57 | 56 | when:
|
58 | 57 | - (item.name | default(item) in nginx_modules_list and nginx_type == 'opensource')
|
59 | 58 | or (item.name | default(item) in nginx_plus_modules_list and nginx_type == 'plus')
|
60 |
| - - not (item.name | default(item) == "auth-spnego") |
61 |
| - or not (ansible_facts['os_family'] == "Alpine" and (ansible_facts['distribution_version'] | regex_search('^[0-9]+\\.[0-9]+') is version('3.8', '=='))) |
62 | 59 | - not (item.name | default(item) == "brotli")
|
63 |
| - or not ((ansible_facts['os_family'] == "Alpine") |
64 |
| - or (ansible_facts['distribution'] == "Amazon") |
65 |
| - or (ansible_facts['os_family'] == "Debian" and ansible_facts['distribution_major_version'] is version('9', '==')) |
66 |
| - or (ansible_facts['distribution'] == "OracleLinux") |
67 |
| - or (ansible_facts['os_family'] == "RedHat" and ansible_facts['distribution_major_version'] is version('8', '<')) |
68 |
| - or (ansible_facts['os_family'] == "Suse" and ansible_facts['distribution_major_version'] is version('12', '<'))) |
| 60 | + or not (ansible_facts['os_family'] == "Suse" and ansible_facts['distribution_major_version'] is version('12', '==')) |
69 | 61 | - not (item.name | default(item) == "geoip")
|
70 | 62 | or not ((ansible_facts['os_family'] == "FreeBSD")
|
71 | 63 | or (ansible_facts['os_family'] == "RedHat" and ansible_facts['distribution_major_version'] is version('8', '>=')))
|
72 | 64 | - not (item.name | default(item) == "geoip2")
|
73 |
| - or not ((ansible_facts['distribution'] == 'Amazon') |
74 |
| - or (ansible_facts['os_family'] == "Suse")) |
| 65 | + or not (ansible_facts['os_family'] == "Suse") |
75 | 66 | - not (item.name | default(item) == "opentracing")
|
76 |
| - or not ((ansible_facts['distribution'] == 'Amazon') |
77 |
| - or (ansible_facts['os_family'] == "Suse" and ansible_facts['distribution_major_version'] is version('12', '=='))) |
| 67 | + or not (ansible_facts['os_family'] == "Suse" and ansible_facts['distribution_major_version'] is version('12', '==')) |
0 commit comments