Debian Codegraph @

test/integration/targets/handlers/test_handlers.yml

raw
1 ---
2 - name: run handlers
3 hosts: A
4 gather_facts: False
5 roles:
6 - { role: test_handlers_meta, tags: ['scenario1'] }
7
8 - name: verify final handler was run
9 hosts: A
10 gather_facts: False
11 tasks:
12 - name: verify handler2 ran
13 assert:
14 that:
15 - "not hostvars[inventory_hostname]['handler1_called']"
16 - "'handler2_called' in hostvars[inventory_hostname]"
17 tags: ['scenario1']
18
19 - name: verify listening handlers
20 hosts: A
21 gather_facts: False
22 tasks:
23 - name: notify some handlers
24 command: echo foo
25 notify:
26 - notify_listen
27 post_tasks:
28 - name: assert all defined handlers ran without error
29 assert:
30 that:
31 - "notify_listen_ran_1 is defined"
32 - "notify_listen_ran_2 is defined"
33 handlers:
34 - name: first listening handler has a name
35 set_fact:
36 notify_listen_ran_1: True
37 listen: notify_listen
38 # second listening handler does not
39 - set_fact:
40 notify_listen_ran_2: True
41 listen: notify_listen
42
43 - name: test handlers
44 hosts: testgroup
45 gather_facts: False
46 roles:
47 - { role: test_handlers }