blob: 54a70c6a78435a0f0a37d6903df572fb18bb9379 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
- 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'
|