Debian Codegraph @

test/integration/targets/handlers/test_flush_in_rescue_always.yml

raw
1 - hosts: A,B
2 gather_facts: false
3 tasks:
4 - block:
5 - name: EXPECTED_FAILURE
6 fail:
7 when: inventory_hostname == 'A'
8 rescue:
9 - command: echo
10 notify: handler_rescue
11
12 - meta: flush_handlers
13
14 - set_fact:
15 was_in_rescue: true
16
17 - name: EXPECTED_FAILURE
18 fail:
19 always:
20 - assert:
21 that:
22 - hostvars['A']['was_in_rescue']|default(false)
23 success_msg: lockstep works
24
25 - command: echo
26 notify: handler_always
27
28 - meta: flush_handlers
29 handlers:
30 - name: handler_rescue
31 debug:
32 msg: handler ran in rescue
33 - name: handler_always
34 debug:
35 msg: handler ran in always