Skip to content

Commit

Permalink
Remove nginx_app_protect_configure parameter (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
alessfg authored Feb 23, 2022
1 parent e901119 commit 428dffd
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 26 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ BREAKING CHANGES:
* Rename `nginx_app_protect_<waf/dos>_state` parameter to `nginx_app_protect_<waf/dos>_setup` parameters.
* Rename multiple `nginx_app_protect_*` parameters and tags to `nginx_app_protect_waf_*` to aid in disambiguation.
* Cleanup remaining Alpine Linux tasks.
* Remove `nginx_app_protect_configure` parameter since it has limited functionality given the `nginx_app_protect_*_policy_file_enable` parameters.

ENHANCEMENTS:

Expand Down
3 changes: 0 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ nginx_app_protect_start: true
nginx_app_protect_service_modify: true
nginx_app_protect_timeout: 180

# Creates basic configuration files and enables NGINX App Protect WAF on the target host
nginx_app_protect_configure: false

# Copy local NGINX App Protect security policy to host
nginx_app_protect_security_policy_file_enable: false
nginx_app_protect_security_policy_file:
Expand Down
1 change: 0 additions & 1 deletion molecule/advanced/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@
nginx_app_protect_remove_license: false
nginx_app_protect_install_signatures: true
nginx_app_protect_install_threat_campaigns: true
nginx_app_protect_configure: true
nginx_app_protect_timeout: 180
42 changes: 20 additions & 22 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,25 @@
include_tasks: "{{ role_path }}/tasks/common/prerequisites/validate-supported-os.yml"
when: nginx_app_protect_waf_state != "absent" or nginx_app_protect_dos_state != "absent"

- name: Check for conflicting WAF config variables
block:
- name: Fail if variables for 'nginx_app_protect_security_policy_file_enable' are not defined
assert:
that:
- "{{ item }} is defined"
- "{{ item }} | length > 0"
loop:
- nginx_app_protect_security_policy_file.0.src
- nginx_app_protect_security_policy_file.0.dest
when: nginx_app_protect_security_policy_file_enable | bool
- name: Fail if variables for 'nginx_app_protect_security_policy_file_enable' are not defined
assert:
that:
- "{{ item }} is defined"
- "{{ item }} | length > 0"
loop:
- nginx_app_protect_security_policy_file.0.src
- nginx_app_protect_security_policy_file.0.dest
when: nginx_app_protect_security_policy_file_enable | bool

- name: Fail if variables for 'nginx_app_protect_log_policy_file_enable' are not defined
assert:
that:
- "{{ item }} is defined"
- "{{ item }} | length > 0"
loop:
- nginx_app_protect_log_policy_file.0.src
- nginx_app_protect_log_policy_file.0.dest
when: nginx_app_protect_log_policy_file_enable | bool
when: nginx_app_protect_configure | bool
- name: Fail if variables for 'nginx_app_protect_log_policy_file_enable' are not defined
assert:
that:
- "{{ item }} is defined"
- "{{ item }} | length > 0"
loop:
- nginx_app_protect_log_policy_file.0.src
- nginx_app_protect_log_policy_file.0.dest
when: nginx_app_protect_log_policy_file_enable | bool

- name: Install prerequisites
include_tasks: "{{ role_path }}/tasks/common/prerequisites/install-dependencies.yml"
Expand Down Expand Up @@ -63,5 +60,6 @@

- name: Configure NGINX App Protect
include_tasks: "{{ role_path }}/tasks/common/config/configure-app-protect.yml"
when: nginx_app_protect_configure | bool
when: nginx_app_protect_security_policy_file_enable | bool
or nginx_app_protect_log_policy_file_enable | bool
tags: nginx_app_protect_configure

0 comments on commit 428dffd

Please sign in to comment.