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.
30 lines
609 B
YAML
30 lines
609 B
YAML
![]()
4 years ago
|
- 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
|