|
6 | 6 | - ansible_facts['distribution'] == "CentOS" |
7 | 7 | - '"geoip" in nginx_modules' |
8 | 8 |
|
9 | | -- name: Install NGINX Modules |
| 9 | +- name: Install NGINX modules |
10 | 10 | package: |
11 | | - name: "nginx-{{ (nginx_type == 'plus') | ternary('plus-', '') }}module-{{ item }}{{ nginx_version | default('') }}" |
12 | | - state: present |
| 11 | + name: "nginx-{{ (nginx_type == 'plus') | ternary('plus-', '') }}module-{{ item.name | default(item) }}\ |
| 12 | + {{ item.version | default(nginx_version) | default('') }}" |
| 13 | + state: "{{ item.state | default('present') }}" |
13 | 14 | loop: "{{ nginx_modules }}" |
14 | 15 | when: |
15 | | - - (item in nginx_modules_list and nginx_type == 'opensource') |
16 | | - or (item in nginx_plus_modules_list and nginx_type == 'plus') |
17 | | - - not (item == "auth-spnego") |
| 16 | + - (item.name | default(item) in nginx_modules_list and nginx_type == 'opensource') |
| 17 | + or (item.name | default(item) in nginx_plus_modules_list and nginx_type == 'plus') |
| 18 | + - not (item.name | default(item) == "auth-spnego") |
18 | 19 | or not (ansible_facts['os_family'] == "Alpine" and (ansible_facts['distribution_version'] | regex_search('^[0-9]+\\.[0-9]+') is version('3.8', '=='))) |
19 | | - - not (item == "geoip") |
| 20 | + - not (item.name | default(item) == "geoip") |
20 | 21 | or not ((ansible_facts['os_family'] == "RedHat" and ansible_facts['distribution_major_version'] is version('8', '==')) |
21 | 22 | or (ansible_facts['os_family'] == "FreeBSD")) |
22 | | - - not (item == "brotli") |
| 23 | + - not (item.name | default(item) == "brotli") |
23 | 24 | or not ((ansible_facts['os_family'] == "Alpine") |
24 | 25 | or (ansible_facts['os_family'] == "RedHat" and ansible_facts['distribution_major_version'] is version('8', '<')) |
25 | 26 | or (ansible_facts['os_family'] == "Debian" and ansible_facts['distribution_major_version'] is version('9', '==')) |
26 | 27 | or (ansible_facts['os_family'] == "Suse" and ansible_facts['distribution_major_version'] is version('12', '<')) |
27 | 28 | or (ansible_facts['distribution'] == "Amazon") |
28 | 29 | or (ansible_facts['distribution'] == "OracleLinux")) |
29 | | - - not (item == "geoip2") or not (ansible_facts['os_family'] == "Suse") |
30 | | - - not (item == "opentracing") |
| 30 | + - not (item.name | default(item) == "geoip2") or not (ansible_facts['os_family'] == "Suse") |
| 31 | + - not (item.name | default(item) == "opentracing") |
31 | 32 | or not ((ansible_facts['os_family'] == "Suse" and ansible_facts['distribution_major_version'] is version('12', '==')) |
32 | 33 | or (ansible_facts['os_family'] == "RedHat" and ansible_facts['distribution_major_version'] is version('6', '=='))) |
0 commit comments