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.
26 lines
656 B
YAML
26 lines
656 B
YAML
10 years ago
|
---
|
||
|
|
||
|
# We notify for A and B, and hosts B and C fail.
|
||
|
# When forcing, we expect A and B to run handlers
|
||
|
# When not forcing, we expect only B to run handlers
|
||
|
|
||
|
- name: notify the handler for host A and B
|
||
|
shell: echo
|
||
|
notify:
|
||
|
- echoing handler
|
||
|
when: inventory_hostname == 'A' or inventory_hostname == 'B'
|
||
|
|
||
|
- name: fail task for all
|
||
|
fail: msg="Fail All"
|
||
|
when: fail_all is defined and fail_all
|
||
|
|
||
|
- name: fail task for A
|
||
|
fail: msg="Fail A"
|
||
|
when: inventory_hostname == 'A'
|
||
|
|
||
|
- name: fail task for C
|
||
|
fail: msg="Fail C"
|
||
|
when: inventory_hostname == 'C'
|
||
|
|
||
|
- name: echo after A and C have failed
|
||
|
command: echo CALLED_TASK_{{ inventory_hostname }}
|