You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,8 @@
4
4
5
5
FEATURES:
6
6
7
-
* Refactor how this role checks if your distribution is supported NGINX App Protect. The role will no longer fail if the target distribution is not supported, instead, you will get a warning. This should help with the occasional lag between new releases of distributions and/or NGINX App Protect and this role being updated to support those releases.
7
+
* Validate that various role variables have been set to one of the allowed values.
8
+
* Refactor how this role checks if your distribution is supported NGINX App Protect. The role will no longer fail if the target distribution is not supported, instead, you will get a warning. This should help with the occasional lag between new releases of distributions and/or NGINX App Protect and this role being updated to support those releases. In addition, the role will also now check if your distribution's architecture is supported.
8
9
* Add support for Debian bullseye for NGINX App Protect WAF.
9
10
* Add support for Oracle Linux 7.x & 8.x for NGINX App Protect WAF.
if ansible_facts['distribution'] | lower in ['ubuntu'] else ansible_facts['distribution_major_version'] in nginx_app_protect_waf_distributions[ansible_facts['distribution'] | lower]['versions'] | string }}"
8
+
- "{{ ansible_facts['architecture'] in nginx_app_protect_waf_distributions[ansible_facts['distribution'] | lower]['architectures'] }}"
9
+
success_msg: Your distribution, {{ nginx_app_protect_waf_distributions[ansible_facts['distribution'] | lower]['name'] }} {{ ansible_facts['distribution_version'] }} ({{ ansible_facts['architecture'] }}), is supported by NGINX App Protect WAF.
10
+
fail_msg: Your distribution, {{ nginx_app_protect_waf_distributions[ansible_facts['distribution'] | lower]['name'] }} {{ ansible_facts['distribution_version'] }} ({{ ansible_facts['architecture'] }}), is not supported by NGINX App Protect WAF.
11
+
when:
12
+
- nginx_app_protect_waf_enable | bool
13
+
- nginx_app_protect_waf_state != "absent"
14
+
ignore_errors: true # noqa ignore-errors
15
+
16
+
- name: (DoS) Check whether you are using a supported NGINX App Protect DoS distribution
17
+
ansible.builtin.assert:
18
+
that:
19
+
- "{{ ansible_facts['distribution'] | lower in nginx_app_protect_dos_distributions.keys() | list }}"
if ansible_facts['distribution'] | lower in ['alpine', 'ubuntu'] else ansible_facts['distribution_major_version'] in nginx_app_protect_dos_distributions[ansible_facts['distribution'] | lower]['versions'] | string }}"
22
+
- "{{ ansible_facts['architecture'] in nginx_app_protect_dos_distributions[ansible_facts['distribution'] | lower]['architectures'] }}"
23
+
success_msg: Your distribution, {{ nginx_app_protect_dos_distributions[ansible_facts['distribution'] | lower]['name'] }} {{ ansible_facts['distribution_version'] }} ({{ ansible_facts['architecture'] }}), is supported by NGINX App Protect DoS.
24
+
fail_msg: Your distribution, {{ nginx_app_protect_dos_distributions[ansible_facts['distribution'] | lower]['name'] }} {{ ansible_facts['distribution_version'] }} ({{ ansible_facts['architecture'] }}), is not supported by NGINX App Protect DoS.
25
+
when:
26
+
- nginx_app_protect_dos_enable | bool
27
+
- nginx_app_protect_dos_state != "absent"
28
+
ignore_errors: true # noqa ignore-errors
29
+
30
+
- name: Warn if installing NGINX App Protect on RHEL >7 without subscription details
31
+
ansible.builtin.fail:
32
+
msg: NGINX App Protect cannot be installed on Red Hat Enterprise Linux {{ ansible_distribution_version }} without a valid Red Hat Enterprise Linux subscription. Subscribe your target environment before running the role and then set the 'nginx_app_protect_use_rhel_subscription_repos' variable to true.
33
+
when:
34
+
- ansible_distribution == "RedHat"
35
+
- ansible_distribution_major_version is version('7', '>')
36
+
- not nginx_app_protect_use_rhel_subscription_repos | bool
37
+
ignore_errors: true # noqa ignore-errors
38
+
39
+
- name: Check that 'nginx_app_protect_waf_setup' is an allowed value
40
+
ansible.builtin.assert:
41
+
that: nginx_app_protect_waf_setup in nginx_app_protect_setup_vars
42
+
fail_msg: The value you used for 'nginx_app_protect_waf_setup', {{ nginx_app_protect_waf_setup }}, is not allowed. The allowed values are [{{ nginx_app_protect_setup_vars | join(', ') }}].
43
+
when: nginx_app_protect_waf_enable | bool
44
+
ignore_errors: true # noqa ignore-errors
45
+
46
+
- name: Check that 'nginx_app_protect_dos_setup' is an allowed value
47
+
ansible.builtin.assert:
48
+
that: nginx_app_protect_dos_setup in nginx_app_protect_setup_vars
49
+
fail_msg: The value you used for 'nginx_app_protect_dos_setup', {{ nginx_app_protect_waf_setup }}, is not allowed. The allowed values are [{{ nginx_app_protect_setup_vars | join(', ') }}].
50
+
when: nginx_app_protect_dos_enable | bool
51
+
ignore_errors: true # noqa ignore-errors
52
+
53
+
- name: Check that the variables for 'nginx_app_protect_security_policy_file_enable' are defined
54
+
ansible.builtin.assert:
55
+
that:
56
+
- "{{ item }} is defined"
57
+
- "{{ item }} | length > 0"
58
+
fail_msg: If you want to publish a security policy file, don't forget to define at least one 'src' and 'dest' variables
Copy file name to clipboardExpand all lines: vars/main.yml
+57-55Lines changed: 57 additions & 55 deletions
Original file line number
Diff line number
Diff line change
@@ -1,47 +1,8 @@
1
1
---
2
-
# NGINX App Protect WAF platform matrix. Populate this dictionary of lists with appropriate values from ansible_distribution and ansible_distribution_version facts
# NGINX App Protect DoS platform matrix. Populate this dictionary of lists with appropriate values from ansible_distribution and ansible_distribution_version facts
# NGINX App Protect WAF platform matrix. Populate this dictionary of lists with appropriate values from ansible_distribution and ansible_distribution_version facts
18
+
nginx_app_protect_waf_distributions:
19
+
amazon:
20
+
name: Amazon Linux
21
+
versions: [2]
22
+
architectures: [x86_64]
23
+
centos:
24
+
name: CentOS
25
+
versions: [7]
26
+
architectures: [x86_64]
27
+
debian:
28
+
name: Debian
29
+
versions: [11]
30
+
architectures: [x86_64]
31
+
oraclelinux:
32
+
name: Oracle Linux
33
+
versions: [8]
34
+
architectures: [x86_64]
35
+
redhat:
36
+
name: Red Hat Enterprise Linux
37
+
versions: [7, 8]
38
+
architectures: [x86_64]
39
+
ubuntu:
40
+
name: Ubuntu
41
+
versions: [18.04, 20.04]
42
+
architectures: [x86_64]
43
+
44
+
# NGINX App Protect DoS platform matrix. Populate this dictionary of lists with appropriate values from ansible_distribution and ansible_distribution_version facts
0 commit comments