mirror of https://github.com/ansible/ansible.git
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.
23 lines
413 B
YAML
23 lines
413 B
YAML
2 years ago
|
- hosts: A,B
|
||
|
gather_facts: false
|
||
|
tasks:
|
||
|
- block:
|
||
|
- command: echo
|
||
|
notify: sometimes_fail
|
||
|
|
||
|
- meta: flush_handlers
|
||
|
rescue:
|
||
|
- debug:
|
||
|
msg: 'rescue ran'
|
||
|
always:
|
||
|
- debug:
|
||
|
msg: 'always ran'
|
||
|
|
||
|
- debug:
|
||
|
msg: 'should run for both hosts'
|
||
|
|
||
|
handlers:
|
||
|
- name: sometimes_fail
|
||
|
fail:
|
||
|
when: inventory_hostname == 'A'
|