1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/var_templating/undefined.yml
Brian Coca 1da47bfa8c
Prevent vars premature templating (#56117)
Avoid premature vars templating
  * added tests
  * avoid 'is template' warning in vars, since we want them for latter templating
2019-05-23 09:42:19 -04:00

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']