|
3 | 3 | include_tasks: "{{ role_path }}/tasks/common/prerequisites/validate-supported-os.yml"
|
4 | 4 | when: nginx_app_protect_waf_state != "absent" or nginx_app_protect_dos_state != "absent"
|
5 | 5 |
|
6 |
| -- name: Check for conflicting WAF config variables |
7 |
| - block: |
8 |
| - - name: Fail if variables for 'nginx_app_protect_security_policy_file_enable' are not defined |
9 |
| - assert: |
10 |
| - that: |
11 |
| - - "{{ item }} is defined" |
12 |
| - - "{{ item }} | length > 0" |
13 |
| - loop: |
14 |
| - - nginx_app_protect_security_policy_file.0.src |
15 |
| - - nginx_app_protect_security_policy_file.0.dest |
16 |
| - when: nginx_app_protect_security_policy_file_enable | bool |
| 6 | +- name: Fail if variables for 'nginx_app_protect_security_policy_file_enable' are not defined |
| 7 | + assert: |
| 8 | + that: |
| 9 | + - "{{ item }} is defined" |
| 10 | + - "{{ item }} | length > 0" |
| 11 | + loop: |
| 12 | + - nginx_app_protect_security_policy_file.0.src |
| 13 | + - nginx_app_protect_security_policy_file.0.dest |
| 14 | + when: nginx_app_protect_security_policy_file_enable | bool |
17 | 15 |
|
18 |
| - - name: Fail if variables for 'nginx_app_protect_log_policy_file_enable' are not defined |
19 |
| - assert: |
20 |
| - that: |
21 |
| - - "{{ item }} is defined" |
22 |
| - - "{{ item }} | length > 0" |
23 |
| - loop: |
24 |
| - - nginx_app_protect_log_policy_file.0.src |
25 |
| - - nginx_app_protect_log_policy_file.0.dest |
26 |
| - when: nginx_app_protect_log_policy_file_enable | bool |
27 |
| - when: nginx_app_protect_configure | bool |
| 16 | +- name: Fail if variables for 'nginx_app_protect_log_policy_file_enable' are not defined |
| 17 | + assert: |
| 18 | + that: |
| 19 | + - "{{ item }} is defined" |
| 20 | + - "{{ item }} | length > 0" |
| 21 | + loop: |
| 22 | + - nginx_app_protect_log_policy_file.0.src |
| 23 | + - nginx_app_protect_log_policy_file.0.dest |
| 24 | + when: nginx_app_protect_log_policy_file_enable | bool |
28 | 25 |
|
29 | 26 | - name: Install prerequisites
|
30 | 27 | include_tasks: "{{ role_path }}/tasks/common/prerequisites/install-dependencies.yml"
|
|
63 | 60 |
|
64 | 61 | - name: Configure NGINX App Protect
|
65 | 62 | include_tasks: "{{ role_path }}/tasks/common/config/configure-app-protect.yml"
|
66 |
| - when: nginx_app_protect_configure | bool |
| 63 | + when: nginx_app_protect_security_policy_file_enable | bool |
| 64 | + or nginx_app_protect_log_policy_file_enable | bool |
67 | 65 | tags: nginx_app_protect_configure
|
0 commit comments