Skip to content

Update supported NGINX Plus dynamic modules #575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jan 22, 2023
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ BREAKING CHANGES:

FEATURES:

* Add AlmaLinux, Oracle Linux and Rocky Linux to the list of NGINX OSS and NGINX Plus tested and supported platforms.
* Add Alpine Linux 3.17 to the NGINX list of tested and supported platforms (and remove Alpine Linux 3.13 from the list of NGINX OSS supported platforms).
* Add support for the newer `ndk` and `set-misc` NGINX Plus dynamic modules and remove old code checks for distributions that are no longer supported.
* Add AlmaLinux, Oracle Linux and Rocky Linux to the list of NGINX OSS and NGINX Plus tested and supported distributions.
* Add Alpine Linux 3.17 to the NGINX list of tested and supported platforms (and remove Alpine Linux 3.13 from the list of NGINX OSS supported distributions).

ENHANCEMENTS:

Expand Down
6 changes: 4 additions & 2 deletions defaults/main/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,16 @@ nginx_modules: []
# - headers-more # NGINX Plus
# - image-filter
# - lua # NGINX Plus
# - ndk # NGINX Plus
# - name: njs # Required
# state: present # Optional
# version: =1.19.4+0.4.4-1~bionic # Optional
# - opentracing # NGINX Plus
# - passenger # NGINX Plus
# - perl # NGINX Plus
# - perl
# - prometheus # NGINX Plus
# - rtmp
# - rtmp # NGINX Plus
# - set-misc # NGINX Plus
# - subs-filter # NGINX Plus
# - waf # NGINX Plus
# - xslt
1 change: 1 addition & 0 deletions molecule/plus/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
- perl
- prometheus
- rtmp
- set-misc
- subs-filter
- xslt
42 changes: 16 additions & 26 deletions tasks/modules/install-modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,36 @@
- '"geoip" in nginx_modules'
- nginx_install_epel_release | bool

- name: (RHEL 7) Install GeoIP2 dependency
- name: (Amazon Linux 2/RHEL 7) Install GeoIP2 dependency
when:
- ansible_facts['distribution'] == "RedHat"
- ansible_facts['distribution_major_version'] is version('7', '==')
- (ansible_facts['distribution'] == "RedHat" and ansible_facts['distribution_major_version'] is version('7', '=='))
or ansible_facts['distribution'] == "Amazon"
- '"geoip2" in nginx_modules'
block:
- name: (RHEL 7) Check if libmaxminddb is available
- name: (Amazon Linux 2/RHEL 7) Check if libmaxminddb is available
ansible.builtin.yum:
list: available
register: packages

- name: (RHEL 7) Install libmaxminddb
- name: (Amazon Linux 2/RHEL 7) Install libmaxminddb
ansible.builtin.yum:
name: https://rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/libmaxminddb-1.2.0-6.el7.x86_64.rpm
when: '"libmaxminddb" not in packages.results'

- name: (AlmaLinux/Oracle Linux/RHEL) Install GeoIP2 and/or OpenTracing EPEL dependency
- name: (AlmaLinux/Amazon Linux 2/Oracle Linux/RHEL/Rocky Linux) Install GeoIP2 and/or OpenTracing EPEL dependency
when:
- ansible_facts['os_family'] == "RedHat" and ansible_facts['distribution'] != "Amazon"
- (ansible_facts['distribution_major_version'] is version('7', '==') and '"geoip2" in nginx_modules')
or '"opentracing" in nginx_modules'
- ansible_facts['os_family'] == "RedHat"
- ('"opentracing" in nginx_modules')
- nginx_install_epel_release | bool
block:
- name: (RHEL) Import EPEL GPG key
- name: (AlmaLinux/Amazon Linux 2/Oracle Linux/RHEL/Rocky Linux) Import EPEL GPG key
ansible.builtin.rpm_key:
state: present
key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_facts['distribution_major_version'] }}
key: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ((ansible_facts['distribution'] == 'Amazon') | ternary('7', ansible_facts['distribution_major_version'])) }}

- name: (RHEL) Install EPEL
- name: (AlmaLinux/Amazon Linux 2/Oracle Linux/RHEL/Rocky Linux) Install EPEL
ansible.builtin.yum:
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_facts['distribution_major_version'] }}.noarch.rpm
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ((ansible_facts['distribution'] == 'Amazon') | ternary('7', ansible_facts['distribution_major_version'])) }}.noarch.rpm

- name: (Alpine Linux) Install Lua and Encrypted Sessions Alpine Linux 3.17 dependency
community.general.apk:
Expand All @@ -46,7 +45,7 @@
- nginx_type == 'plus'
- ansible_facts['os_family'] == "Alpine"
- ansible_facts['distribution_version'] | regex_search('^[0-9]+\\.[0-9]+') is version('3.17', '==')
- ('"lua" in nginx_modules') or ('"encrypted-sessions" in nginx_modules')
- ('"encrypted-sessions" in nginx_modules') or ('"lua" in nginx_modules') or ('"set-misc" in nginx_modules')

- name: Setup NGINX modules
ansible.builtin.package:
Expand All @@ -57,21 +56,12 @@
when:
- (item.name | default(item) in nginx_modules_list and nginx_type == 'opensource')
or (item.name | default(item) in nginx_plus_modules_list and nginx_type == 'plus')
- not (item.name | default(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.name | default(item) == "brotli")
or not ((ansible_facts['os_family'] == "Alpine")
or (ansible_facts['distribution'] == "Amazon")
or (ansible_facts['os_family'] == "Debian" and ansible_facts['distribution_major_version'] is version('9', '=='))
or (ansible_facts['distribution'] == "OracleLinux")
or (ansible_facts['os_family'] == "RedHat" and ansible_facts['distribution_major_version'] is version('8', '<'))
or (ansible_facts['os_family'] == "Suse" and ansible_facts['distribution_major_version'] is version('12', '<')))
or not (ansible_facts['os_family'] == "Suse" and ansible_facts['distribution_major_version'] is version('12', '=='))
- not (item.name | default(item) == "geoip")
or not ((ansible_facts['os_family'] == "FreeBSD")
or (ansible_facts['os_family'] == "RedHat" and ansible_facts['distribution_major_version'] is version('8', '>=')))
- not (item.name | default(item) == "geoip2")
or not ((ansible_facts['distribution'] == 'Amazon')
or (ansible_facts['os_family'] == "Suse"))
or not (ansible_facts['os_family'] == "Suse")
- not (item.name | default(item) == "opentracing")
or not ((ansible_facts['distribution'] == 'Amazon')
or (ansible_facts['os_family'] == "Suse" and ansible_facts['distribution_major_version'] is version('12', '==')))
or not (ansible_facts['os_family'] == "Suse" and ansible_facts['distribution_major_version'] is version('12', '=='))
2 changes: 1 addition & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,5 @@ nginx_modules_list: [
# Supported NGINX Plus dynamic modules
nginx_plus_modules_list: [
auth-spnego, brotli, encrypted-session, geoip, geoip2, headers-more, image-filter,
lua, njs, opentracing, passenger, perl, prometheus, rtmp, subs-filter, xslt,
lua, ndk, njs, opentracing, passenger, perl, prometheus, rtmp, set-misc, subs-filter, xslt,
]