Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run all handlers with the same
listen
topic when notified from anot…
- Loading branch information
Showing
4 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
changelogs/fragments/82363-multiple-handlers-with-recursive-notification.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bugfixes: | ||
- Run all handlers with the same ``listen`` topic, even when notified from another handler (https://github.com/ansible/ansible/issues/82363). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
test/integration/targets/handlers/test_multiple_handlers_with_recursive_notification.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
- name: test multiple handlers with recursive notification | ||
hosts: localhost | ||
gather_facts: false | ||
|
||
tasks: | ||
- name: notify handler 1 | ||
command: echo | ||
changed_when: true | ||
notify: handler 1 | ||
|
||
- meta: flush_handlers | ||
|
||
- name: verify handlers | ||
assert: | ||
that: | ||
- "ran_handler_1 is defined" | ||
- "ran_handler_2a is defined" | ||
- "ran_handler_2b is defined" | ||
|
||
handlers: | ||
- name: handler 1 | ||
set_fact: | ||
ran_handler_1: True | ||
changed_when: true | ||
notify: handler_2 | ||
|
||
- name: handler 2a | ||
set_fact: | ||
ran_handler_2a: True | ||
listen: handler_2 | ||
|
||
- name: handler 2b | ||
set_fact: | ||
ran_handler_2b: True | ||
listen: handler_2 |