summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/var_templating/undefined.yml
blob: cf083d5f118547ec5544f1332e25c77ea0518d5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
- 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']