Debian Codegraph @

test/integration/targets/strategy_linear/task_templated_run_once.yml

raw
1 - hosts: testhost,testhost2
2 gather_facts: no
3 vars:
4 run_once_flag: false
5 tasks:
6 - debug:
7 msg: "I am {{ item }}"
8 run_once: "{{ run_once_flag }}"
9 register: reg1
10 loop:
11 - "{{ inventory_hostname }}"
12
13 - assert:
14 that:
15 - "reg1.results[0].msg == 'I am testhost'"
16 when: inventory_hostname == 'testhost'
17 - assert:
18 that:
19 - "reg1.results[0].msg == 'I am testhost2'"
20 when: inventory_hostname == 'testhost2'