diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
commit | 8a754e0858d922e955e71b253c139e071ecec432 (patch) | |
tree | 527d16e74bfd1840c85efd675fdecad056c54107 /test/integration/targets/handlers/test_listening_handlers.yml | |
parent | Initial commit. (diff) | |
download | ansible-core-8a754e0858d922e955e71b253c139e071ecec432.tar.xz ansible-core-8a754e0858d922e955e71b253c139e071ecec432.zip |
Adding upstream version 2.14.3.upstream/2.14.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/targets/handlers/test_listening_handlers.yml')
-rw-r--r-- | test/integration/targets/handlers/test_listening_handlers.yml | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/integration/targets/handlers/test_listening_handlers.yml b/test/integration/targets/handlers/test_listening_handlers.yml new file mode 100644 index 0000000..f4c3cae --- /dev/null +++ b/test/integration/targets/handlers/test_listening_handlers.yml @@ -0,0 +1,39 @@ +--- +- name: verify listening handlers + hosts: A + gather_facts: False + tasks: + - name: notify some handlers + command: echo foo + notify: + - notify_listen + + - name: notify another handler + debug: + changed_when: true + notify: another_listen + + - name: nofity another handler 2 + debug: + changed_when: true + notify: another_listen + post_tasks: + - name: assert all defined handlers ran without error + assert: + that: + - "notify_listen_ran_1 is defined" + - "notify_listen_ran_2 is defined" + - "another_listen_ran is true" + handlers: + - name: first listening handler has a name + set_fact: + notify_listen_ran_1: True + listen: notify_listen + # second listening handler does not + - set_fact: + notify_listen_ran_2: True + listen: notify_listen + + - set_fact: + another_listen_ran: '{{ False if another_listen_ran is defined else True }}' + listen: another_listen |