You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/strategy_linear/task_templated_run_once.yml

21 lines
496 B
YAML

- hosts: testhost,testhost2
gather_facts: no
vars:
run_once_flag: false
tasks:
- debug:
msg: "I am {{ item }}"
run_once: "{{ run_once_flag }}"
register: reg1
loop:
- "{{ inventory_hostname }}"
- assert:
that:
- "reg1.results[0].msg == 'I am testhost'"
when: inventory_hostname == 'testhost'
- assert:
that:
- "reg1.results[0].msg == 'I am testhost2'"
when: inventory_hostname == 'testhost2'