mirror of https://github.com/ansible/ansible.git
native types: properly handle Undefined in nested data (#68432)
parent
3bec27dc34
commit
5ca3aec3c4
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- native jinja2 types - properly handle Undefined in nested data.
|
@ -1 +0,0 @@
|
||||
host1
|
@ -0,0 +1,24 @@
|
||||
- hosts: localhost
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- block:
|
||||
- name: Test nested undefined var fails, single node
|
||||
debug:
|
||||
msg: "{{ [{ 'key': nested_and_undefined }] }}"
|
||||
register: result
|
||||
ignore_errors: yes
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "\"'nested_and_undefined' is undefined\" in result.msg"
|
||||
|
||||
- name: Test nested undefined var fails, multiple nodes
|
||||
debug:
|
||||
msg: "{{ [{ 'key': nested_and_undefined}] }} second_node"
|
||||
register: result
|
||||
ignore_errors: yes
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "\"'nested_and_undefined' is undefined\" in result.msg"
|
||||
when: lookup('pipe', ansible_python_interpreter ~ ' -c "import jinja2; print(jinja2.__version__)"') is version('2.10', '>=')
|
Loading…
Reference in New Issue