File tree Expand file tree Collapse file tree 3 files changed +25
-6
lines changed Expand file tree Collapse file tree 3 files changed +25
-6
lines changed Original file line number Diff line number Diff line change 31
31
src : " {{ nginx_conf_template.template_file }}"
32
32
dest : " {{ nginx_conf_template.out_file_location }}{{ nginx_conf_template.out_file_name }}"
33
33
backup : true
34
- when : nginx_conf_template_enable
34
+ when :
35
+ - nginx_conf_template_enable
36
+ - app_protect_state != "absent"
37
+
38
+ - name : " Remove NGINX App Protect"
39
+ block :
40
+
41
+ - name : Comment out NGINX App Protect module reference in nginx.conf
42
+ replace :
43
+ path : /etc/nginx/nginx.conf
44
+ regexp : ' ^([ \t]*load_module.*ngx_http_app_protect_module.so;)'
45
+ replace : ' # \1'
46
+
47
+ - name : Comment out NGINX App Protect directives in nginx.conf
48
+ replace :
49
+ path : /etc/nginx/nginx.conf
50
+ regexp : ' ^([ \t]*app_protect_)'
51
+ replace : ' # \1'
52
+
53
+ when : app_protect_state == "absent"
35
54
36
55
- name : " Reload NGINX"
37
56
debug :
Original file line number Diff line number Diff line change 16
16
17
17
- name : " (Install: Linux) Install NGINX Plus"
18
18
import_tasks : install-app-protect-linux.yml
19
- # should not be needed, as a check is occurring for this in a higher level playbook is occuring
20
- # when: ansible_os_family in nginx_plus_linux_families
Original file line number Diff line number Diff line change 68
68
69
69
- name : " Configure NGINX App Protect"
70
70
import_tasks : configure-app-protect.yml
71
- when :
72
- - supported_os
73
- - app_protect_configure
71
+ when : app_protect_configure
74
72
75
73
when : app_protect_state != "absent"
76
74
80
78
- name : " Remove NGINX App Protect"
81
79
import_tasks : install-app-protect.yml
82
80
81
+ - name : " Disable NGINX App Protect Configuration"
82
+ import_tasks : configure-app-protect.yml
83
+ when : app_protect_configure
84
+
83
85
when : app_protect_state == "absent"
You can’t perform that action at this time.
0 commit comments