Skip to content

Commit 9228af3

Browse files
committed
changed when
1 parent a2585d0 commit 9228af3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tasks/prerequisites/setup-selinux.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
template:
9696
src: nginx-plus-module-appprotect.te.j2
9797
dest: "{{ app_protect_tempdir }}/nginx-plus-module-appprotect.te"
98+
register: app_protect_module
9899

99100
- name: "(Install: SELinux: Module) Check NGINX Plus App Protect Module"
100101
command: "checkmodule -M -m -o {{ app_protect_tempdir }}/nginx-plus-module-appprotect.mod {{ app_protect_tempdir }}/nginx-plus-module-appprotect.te"
@@ -111,11 +112,13 @@
111112
- name: "(Install: SELinux: Module) Import NGINX Plus App Protect Module"
112113
command: "semodule -i {{ app_protect_tempdir }}/nginx-plus-module-appprotect.pp"
113114
changed_when: false
115+
when: app_protect_module.changed
114116

115117
- name: "(Install: SELinux: Module) Create NGINX Plus Metrics Module"
116118
template:
117119
src: nginx-plus-module-f5-metrics.te.j2
118120
dest: "{{ app_protect_tempdir }}/nginx-plus-module-f5-metrics.te"
121+
register: f5_metrics_module
119122

120123
- name: "(Install: SELinux: Module) Check NGINX Plus Metrics Module"
121124
command: "checkmodule -M -m -o {{ app_protect_tempdir }}/nginx-plus-module-f5-metrics.mod {{ app_protect_tempdir }}/nginx-plus-module-f5-metrics.te"
@@ -132,6 +135,7 @@
132135
- name: "(Install: SELinux: Module) Import NGINX Plus Metrics Module"
133136
command: "semodule -i {{ app_protect_tempdir }}/nginx-plus-module-f5-metrics.pp"
134137
changed_when: false
138+
when: f5_metrics_module.changed
135139

136140
- name: "(Install: SELinux) Enforce SELinux"
137141
selinux:

0 commit comments

Comments
 (0)