ansible_concat: return strings only unless eval (#76634)

Fixes #76610
pull/76688/head
Martin Krizek 3 years ago committed by GitHub
parent b984dd9c59
commit 094a0746b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- "Fix for when templating empty template file resulted in file with string 'None' (https://github.com/ansible/ansible/issues/76610)"

@ -60,7 +60,7 @@ def ansible_concat(nodes, convert_data, variable_start_string):
head = list(islice(nodes, 2))
if not head:
return None
return ''
if len(head) == 1:
out = _fail_on_undefined(head[0])

@ -756,3 +756,13 @@
- assert:
that:
- out.rc == 0
- template:
src: empty_template.j2
dest: "{{ output_dir }}/empty_template.templated"
- assert:
that:
- test
vars:
test: "{{ lookup('file', '{{ output_dir }}/empty_template.templated')|length == 0 }}"

Loading…
Cancel
Save