summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/undefined/tasks/main.yml
blob: 5bf478606cc2abaa53d5dfbf3cd7131e9800d554 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- set_fact:
    names: '{{ things|map(attribute="name") }}'
  vars:
    things:
      - name: one
      - name: two
      - notname: three
      - name: four
  ignore_errors: true
  register: undefined_set_fact

- assert:
    that:
      - '("%r"|format(undefined_variable)).startswith("AnsibleUndefined")'
      - undefined_set_fact is failed
      - undefined_set_fact.msg is contains 'undefined variable'