Debian Codegraph @

test/integration/targets/strategy_linear/task_action_templating.yml

raw
1 - hosts: testhost,testhost2
2 gather_facts: no
3 tasks:
4 - set_fact:
5 module_to_run: 'debug'
6 when: inventory_hostname == 'testhost'
7
8 - set_fact:
9 module_to_run: 'ping'
10 when: inventory_hostname == 'testhost2'
11
12 - action:
13 module: '{{ module_to_run }}'
14 register: out
15
16 - assert:
17 that:
18 - "'msg' in out"
19 - "'ping' not in out"
20 when: inventory_hostname == 'testhost'
21
22 - assert:
23 that:
24 - "'ping' in out"
25 - "'msg' not in out"
26 when: inventory_hostname == 'testhost2'