ansible/test/integration/targets/template/undefined_var_info.yml
Martin Krizek 4df129c6ae
Provide more information in AnsibleUndefinedVariable (#71666) (#71876)
* Provide more information in AnsibleUndefinedVariable

Fixes #55152

(cherry picked from commit 00b22ab55e)
2020-09-28 00:34:38 -05:00

15 lines
297 B
YAML

- hosts: localhost
gather_facts: no
vars:
foo: []
bar: "{{ foo[0] }}"
tasks:
- debug:
msg: "{{ bar }}"
register: result
ignore_errors: yes
- assert:
that:
- '"foo[0]" in result.msg'
- '"object has no element 0" in result.msg'