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_host_pinned/playbook.yml

47 lines
1.0 KiB
YAML

# README - even the name of the tasks matter in this test, see callback_plugins/callback_host_count.py
- hosts: all
gather_facts: false
strategy: host_pinned
pre_tasks:
# by executing in pre_tasks we ensure that "start" is the first task in the play,
# not an implicit "meta: flush_handlers" after pre_tasks
- name: start
debug:
msg: start
- ping:
- meta: noop
post_tasks:
# notifying a handler in post_tasks ensures the handler is the last task in the play,
# not an implicit "meta: flush_handlers" after post_tasks
- debug:
changed_when: true
notify: end
handlers:
- name: end
debug:
msg: end
- hosts: localhost0,localhost1,localhost2
gather_facts: false
strategy: host_pinned
pre_tasks:
- name: start
debug:
msg: start
- command: sleep 3
when: inventory_hostname == "localhost0"
- meta: noop
- meta: noop
post_tasks:
- debug:
changed_when: true
notify: end
handlers:
- name: end
debug:
msg: end