forked from ansible/ansible
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test case is based on reproducer given in ansible#80880, with some minor adjustments and assertions.
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
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,34 @@ | ||
--- | ||
- name: Test notification of handlers from other handlers | ||
hosts: localhost | ||
gather_facts: no | ||
handlers: | ||
- name: Handler 1 | ||
debug: | ||
msg: Handler 1 | ||
changed_when: true | ||
notify: Handler 2 | ||
register: handler1_res | ||
- name: Handler 2 | ||
debug: | ||
msg: Handler 2 | ||
changed_when: true | ||
notify: Handler 3 | ||
register: handler2_res | ||
- name: Handler 3 | ||
debug: | ||
msg: Handler 3 | ||
register: handler3_res | ||
tasks: | ||
- name: Trigger handlers | ||
ansible.builtin.debug: | ||
msg: Task 1 | ||
changed_when: true | ||
notify: Handler 1 | ||
post_tasks: | ||
- name: Assert results | ||
ansible.builtin.assert: | ||
that: | ||
- "handler1_res is defined and handler1_res is success" | ||
- "handler2_res is defined and handler2_res is success" | ||
- "handler3_res is defined and handler3_res is success" |
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