Skip to content

Commit 4fb4402

Browse files
committed
feat: Add validation task for NGINX modules
1 parent bb4d010 commit 4fb4402

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ BREAKING CHANGES:
1010

1111
FEATURES:
1212

13+
- Add support for installing the NGINX Plus HA keepalived package.
14+
- Add validation tasks to check the Ansible version, the Jinja2 version, and whether the required Ansible collections for this role are installed.
1315
- Add support for installing NGINX Open Source on Alpine Linux 3.20.
1416
- Add support for installing NGINX Agent on Ubuntu noble.
15-
- Add validation tasks to check the Ansible version, the Jinja2 version, and whether the required Ansible collections for this role are installed.
1617
- Bump the minimum version of Ansible supported to `2.16`, whilst clarifying that Ansible `2.18` is not supported at this stage.
1718
- Bump the Ansible `community.general` collection to `9.2.0`, `community.crypto` collection to `2.21.1` and `community.docker` collection to `3.11.0`.
1819

@@ -28,6 +29,7 @@ TESTS:
2829
MAINTENANCE:
2930

3031
- Installing certain NGINX modules on Alpine Linux 3.17 no longer requires installing `nginx-plus-module-ndk` as a separate step.
32+
- Add an `ansible_managed` comment to the various templated configs deployed by the role.
3133

3234
CI/CD:
3335

molecule/plus/converge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- encrypted-session
1818
- geoip
1919
- geoip2
20+
- ha-keepalived
2021
- headers-more
2122
- image-filter
2223
- lua

tasks/validate/validate.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,16 @@
9999
- nginx_enable | bool
100100
- (nginx_install_from == "nginx_repository" or nginx_type == "plus")
101101
ignore_errors: true # noqa ignore-errors
102+
103+
- name: Verify that you are installing a supported NGINX dynamic module
104+
ansible.builtin.assert:
105+
that: (nginx_modules | difference(nginx_modules_list) == [] if nginx_type == 'opensource') or (nginx_modules | difference(nginx_plus_modules_list) == [] if nginx_type == 'plus')
106+
success_msg: The NGINX module(s) you are installing are supported.
107+
fail_msg: The NGINX module(s) you are installing are not supported. Please check the README for more details.
108+
when:
109+
- nginx_enable | bool
110+
- nginx_modules is defined
111+
- nginx_modules | length > 0
112+
delegate_to: localhost
113+
become: false
114+
ignore_errors: true # noqa ignore-errors

vars/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,4 @@ openssl_version: 3.0.7
153153
nginx_modules_list: [geoip, image-filter, njs, perl, xslt]
154154

155155
# Supported NGINX Plus dynamic modules
156-
nginx_plus_modules_list: [auth-spnego, brotli, encrypted-session, geoip, geoip2, headers-more, image-filter, lua, ndk, njs, opentracing, passenger, perl, prometheus, rtmp, set-misc, subs-filter, xslt]
156+
nginx_plus_modules_list: [auth-spnego, brotli, encrypted-session, geoip, geoip2, ha-keepalived, headers-more, image-filter, lua, ndk, njs, opentracing, passenger, perl, prometheus, rtmp, set-misc, subs-filter, xslt]

0 commit comments

Comments
 (0)