ansible-role-nginx/tasks/modules/install-modules.yml
2020-09-19 17:32:17 +02:00

33 lines
1.8 KiB
YAML

---
- name: (CentOS) Install GeoIP dependencies
yum:
name: epel-release
when:
- ansible_facts['distribution'] == "CentOS"
- '"geoip" in nginx_modules'
- name: Install NGINX Modules
package:
name: "nginx-{{ (nginx_type == 'plus') | ternary('plus-', '') }}module-{{ item }}{{ nginx_version | default('') }}"
state: present
loop: "{{ nginx_modules }}"
when:
- (item in nginx_modules_list and nginx_type == 'opensource')
or (item in nginx_plus_modules_list and nginx_type == 'plus')
- not (item == "auth-spnego")
or not (ansible_facts['os_family'] == "Alpine" and (ansible_facts['distribution_version'] | regex_search('^[0-9]+\\.[0-9]+') is version('3.8', '==')))
- not (item == "geoip")
or not ((ansible_facts['os_family'] == "RedHat" and ansible_facts['distribution_major_version'] is version('8', '=='))
or (ansible_facts['os_family'] == "FreeBSD"))
- not (item == "brotli")
or not ((ansible_facts['os_family'] == "Alpine")
or (ansible_facts['os_family'] == "RedHat" and ansible_facts['distribution_major_version'] is version('8', '<'))
or (ansible_facts['os_family'] == "Debian" and ansible_facts['distribution_major_version'] is version('9', '=='))
or (ansible_facts['os_family'] == "Suse" and ansible_facts['distribution_major_version'] is version('12', '<'))
or (ansible_facts['distribution'] == "Amazon")
or (ansible_facts['distribution'] == "OracleLinux"))
- not (item == "geoip2") or not (ansible_facts['os_family'] == "Suse")
- not (item == "opentracing")
or not ((ansible_facts['os_family'] == "Suse" and ansible_facts['distribution_major_version'] is version('12', '=='))
or (ansible_facts['os_family'] == "RedHat" and ansible_facts['distribution_major_version'] is version('6', '==')))