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.
25 lines
534 B
YAML
25 lines
534 B
YAML
2 years ago
|
- hosts: host1,host2
|
||
|
gather_facts: no
|
||
|
tasks:
|
||
|
- block:
|
||
|
- block:
|
||
|
- name: EXPECTED FAILURE host1 fails
|
||
|
fail:
|
||
|
when: inventory_hostname == 'host1'
|
||
|
|
||
|
- set_fact:
|
||
|
only_host2_fact: yes
|
||
|
|
||
|
- name: should not fail
|
||
|
fail:
|
||
|
when: only_host2_fact is not defined
|
||
|
always:
|
||
|
- block:
|
||
|
- meta: clear_host_errors
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- only_host2_fact is defined
|
||
|
when:
|
||
|
- inventory_hostname == 'host2'
|