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.
14 lines
377 B
YAML
14 lines
377 B
YAML
6 years ago
|
- hosts: localhost
|
||
|
gather_facts: false
|
||
|
tasks:
|
||
|
- name: show defined/undefined var
|
||
|
debug: var=mytest
|
||
|
vars:
|
||
|
mytest: '{{ und }}'
|
||
|
register: var_undefined
|
||
|
|
||
|
- name: ensure either mytest is defined or debug finds it to be undefined
|
||
|
assert:
|
||
|
that:
|
||
|
- mytest is defined or 'VARIABLE IS NOT DEFINED!' in var_undefined['mytest']
|