blob: 70628809a4b6bd3f1df20dc870625ac869ce6d49 (
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
25
26
27
28
29
|
- hosts: localhost
gather_facts: false
tasks:
- debug: msg={{item}}
with_dict: '{{myundef}}'
when:
- myundef is defined
register: shouldskip
- name: check if skipped
assert:
that:
- shouldskip is skipped
- debug: msg={{item}}
loop: '{{myundef|dict2items}}'
when:
- myundef is defined
- debug: msg={{item}}
with_dict: '{{myundef}}'
register: notskipped
ignore_errors: true
- name: check it failed
assert:
that:
- notskipped is not skipped
- notskipped is failed
|