Skip to content

Commit 1cee392

Browse files
committed
Ensure molecule verifier passes
1 parent 2b9364c commit 1cee392

File tree

6 files changed

+30
-29
lines changed

6 files changed

+30
-29
lines changed

molecule/default/converge.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
---
22
- name: Converge
33
hosts: all
4-
vars:
5-
nginx_app_protect_enable: true
6-
nginx_app_protect_install_signatures: true
7-
nginx_app_protect_install_threat_campaigns: true
8-
nginx_app_protect_configure: true
9-
nginx_app_protect_security_policy_template_enable: true
10-
nginx_app_protect_security_policy_enforcement_mode: blocking
11-
nginx_app_protect_log_policy_template_enable: true
12-
nginx_app_protect_log_policy_filter_request_type: all
13-
nginx_app_protect_conf_template_enable: true
14-
nginx_app_protect_log_policy_syslog_target: 10.1.10.105:5144
15-
nginx_app_protect_demo_workload_protocol: http://
16-
nginx_app_protect_demo_workload_host: 10.1.10.105:8080
17-
nginx_app_protect_license:
18-
certificate: "license/nginx-repo.crt"
19-
key: "license/nginx-repo.key"
20-
214
tasks:
22-
- name: "Include ansible-role-nginx-app-protect"
5+
- name: Install NGINX App Protect
236
include_role:
24-
name: "ansible-role-nginx-app-protect"
7+
name: ansible-role-nginx-app-protect
8+
vars:
9+
nginx_app_protect_enable: true
10+
nginx_app_protect_install_signatures: true
11+
nginx_app_protect_install_threat_campaigns: true
12+
nginx_app_protect_configure: true
13+
nginx_app_protect_security_policy_template_enable: true
14+
nginx_app_protect_security_policy_enforcement_mode: blocking
15+
nginx_app_protect_log_policy_template_enable: true
16+
nginx_app_protect_log_policy_filter_request_type: all
17+
nginx_app_protect_conf_template_enable: true
18+
nginx_app_protect_log_policy_syslog_target: 10.1.10.105:5144
19+
nginx_app_protect_demo_workload_protocol: http://
20+
nginx_app_protect_demo_workload_host: 10.1.10.105:8080
21+
nginx_app_protect_license:
22+
certificate: "license/nginx-repo.crt"
23+
key: "license/nginx-repo.key"
24+
nginx_app_protect_delete_license: false

molecule/default/verify.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,3 @@
1717
check_mode: yes
1818
register: service
1919
failed_when: (service is changed) or (service is failed)
20-
21-
- name: Verify NGINX is up and running
22-
uri:
23-
url: http://localhost
24-
status_code: 200

tasks/config/configure-app-protect.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
- name: Reload NGINX
6161
debug:
62-
msg: "trigger nginx reload if needed"
62+
msg: Trigger nginx reload if needed
6363
notify: (Handler) Restart NGINX
6464
when: nginx_app_protect_security_policy_template_enable | bool
6565
or nginx_app_protect_log_policy_template_enable | bool

tasks/install/install-app-protect.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@
4545
package:
4646
name: "app-protect{{ nginx_app_protect_version | default('') }}"
4747
state: "{{ nginx_app_protect_state }}"
48-
notify: (Handler) Restart NGINX
48+
notify: (Handler) Start NGINX

tasks/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,18 @@
5858
- nginx_app_protect_state != "absent"
5959
or nginx_app_protect_install_signatures | bool
6060
or nginx_app_protect_install_threat_campaigns | bool
61+
tags: nginx_app_protect_setup_license
6162

6263
- name: Install NGINX App Protect
6364
include_tasks: "{{ role_path }}/tasks/install/install-app-protect.yml"
65+
tags: nginx_app_protect_install_app_protect
6466

6567
- name: Install NGINX App Protect signatures and threat campaigns
6668
include_tasks: "{{ role_path }}/tasks/install/install-signatures-threat-campaigns.yml"
6769
when:
6870
- nginx_app_protect_install_signatures | bool
6971
- nginx_app_protect_install_threat_campaigns | bool
72+
tags: nginx_app_protect_install_signatures_threats
7073

7174
- name: Remove NGINX App Protect license
7275
include_tasks: "{{ role_path }}/tasks/install/delete-license.yml"
@@ -76,14 +79,17 @@
7679
- name: Configure NGINX App Protect
7780
include_tasks: "{{ role_path }}/tasks/config/configure-app-protect.yml"
7881
when: nginx_app_protect_configure | bool
82+
tags: nginx_app_protect_configure
7983
when: nginx_app_protect_state != "absent"
8084

8185
- name: Remove NGINX App Protect
8286
block:
8387
- name: Remove NGINX App Protect package
8488
include_tasks: "{{ role_path }}/tasks/install/install-app-protect.yml"
89+
tags: nginx_app_protect_remove
8590

8691
- name: Disable NGINX App Protect config
8792
include_tasks: "{{ role_path }}/tasks/config/configure-app-protect.yml"
8893
when: nginx_app_protect_configure | bool
94+
tags: nginx_app_protect_remove_config
8995
when: nginx_app_protect_state == "absent"

templates/nginx.conf.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
load_module modules/ngx_http_app_protect_module.so;
2+
13
user nginx;
24
worker_processes 1;
35

4-
load_module modules/ngx_http_app_protect_module.so;
5-
66
error_log /var/log/nginx/error.log debug;
77

88
events {
@@ -35,4 +35,4 @@ http {
3535
proxy_pass {{ nginx_app_protect_demo_workload_protocol }}backend_hosts$request_uri;
3636
}
3737
}
38-
}
38+
}

0 commit comments

Comments
 (0)