Skip to content

Commit 11cf510

Browse files
authored
Use more specific handler names (#27)
1 parent adbf1ad commit 11cf510

File tree

4 files changed

+21
-19
lines changed

4 files changed

+21
-19
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 0.3.1 (Unreleased)
4+
5+
BUG FIXES:
6+
7+
* Rename handlers to use more specific role related naming and prevent namespace collision issues.
8+
39
## 0.3.0 (September 21, 2020)
410

511
DEPRECATION WARNING:

handlers/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
---
2-
- name: (Handler) Systemd daemon-reload
2+
- name: (Handler - NGINX App Protect) Systemd daemon-reload
33
systemd:
44
daemon_reload: true
55

6-
- name: (Handler) Check NGINX
6+
- name: (Handler - NGINX App Protect) Check NGINX
77
command: nginx -t
88
register: config
99
ignore_errors: true
10-
listen: (Handler) Run NGINX
10+
listen: (Handler - NGINX App Protect) Run NGINX
1111

12-
- name: (Handler) Print NGINX error if syntax check fails
12+
- name: (Handler - NGINX App Protect) Print NGINX error if syntax check fails
1313
debug:
1414
var: config.stderr_lines
1515
failed_when: config.rc != 0
1616
when: config.rc != 0
17-
listen: (Handler) Run NGINX
17+
listen: (Handler - NGINX App Protect) Run NGINX
1818

19-
- name: (Handler) Start/Reload NGINX
19+
- name: (Handler - NGINX App Protect) Start/reload NGINX
2020
service:
2121
name: nginx
2222
state: reloaded
2323
enabled: true
2424
when:
2525
- nginx_app_protect_start | bool
2626
- not ansible_check_mode | bool
27-
listen: (Handler) Run NGINX
27+
listen: (Handler - NGINX App Protect) Run NGINX

tasks/config/configure-app-protect.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
mode: 0644
1616
backup: true
1717
when: nginx_app_protect_security_policy_template_enable | bool
18+
notify: (Handler - NGINX App Protect) Run NGINX
1819

1920
- name: Dynamically generate NGINX App Protect log policy file
2021
template:
@@ -23,6 +24,7 @@
2324
mode: 0644
2425
backup: true
2526
when: nginx_app_protect_log_policy_template_enable | bool
27+
notify: (Handler - NGINX App Protect) Run NGINX
2628

2729
- name: (DEPRECATED) Backup existing nginx.conf
2830
copy:
@@ -41,6 +43,7 @@
4143
when:
4244
- nginx_app_protect_conf_template_enable | bool
4345
- nginx_app_protect_state != "absent"
46+
notify: (Handler - NGINX App Protect) Run NGINX
4447

4548
- name: (DEPRECATED) Remove NGINX App Protect
4649
block:
@@ -55,12 +58,5 @@
5558
path: /etc/nginx/nginx.conf
5659
regexp: '^([ \t]*app_protect_)'
5760
replace: '# \1'
61+
notify: (Handler - NGINX App Protect) Run NGINX
5862
when: nginx_app_protect_state == "absent"
59-
60-
- name: Reload NGINX
61-
debug:
62-
msg: Trigger nginx reload if needed
63-
notify: (Handler) Run NGINX
64-
when: nginx_app_protect_security_policy_template_enable | bool
65-
or nginx_app_protect_log_policy_template_enable | bool
66-
or nginx_app_protect_conf_template_enable | bool

tasks/install/install-app-protect.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@
2222
package:
2323
name: "app-protect{{ nginx_app_protect_version | default('') }}"
2424
state: "{{ nginx_app_protect_state }}"
25-
notify: (Handler) Run NGINX
25+
notify: (Handler - NGINX App Protect) Run NGINX
2626

2727
- name: Install latest NGINX App Protect signatures
2828
package:
2929
name: app-protect-attack-signatures
3030
state: "{{ nginx_app_protect_state }}"
3131
when: nginx_app_protect_install_signatures | bool
32-
notify: (Handler) Run NGINX
32+
notify: (Handler - NGINX App Protect) Run NGINX
3333

3434
- name: Install latest NGINX App Protect threat campaigns
3535
package:
3636
name: app-protect-threat-campaigns
3737
state: "{{ nginx_app_protect_state }}"
3838
when: nginx_app_protect_install_threat_campaigns | bool
39-
notify: (Handler) Run NGINX
39+
notify: (Handler - NGINX App Protect) Run NGINX
4040

4141
- name: Modify NGINX Plus service
4242
block:
@@ -53,5 +53,5 @@
5353
owner: root
5454
group: root
5555
mode: 0644
56-
notify: (Handler) Systemd daemon-reload
56+
notify: (Handler - NGINX App Protect) Systemd daemon-reload
5757
when: nginx_app_protect_timeout is defined

0 commit comments

Comments
 (0)