1da47bfa8c
Avoid premature vars templating * added tests * avoid 'is template' warning in vars, since we want them for latter templating
13 lines
377 B
YAML
13 lines
377 B
YAML
- 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']
|