mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 05:40:23 -07:00
Set Jinja2's keep_trailing_newline=True in template_from_string.
Without this setting, the newline idempotence of scalar strings changes depending on whether or not they contain any Jinja2 template blocks.
This commit is contained in:
parent
7c6175e780
commit
7a8eb0b670
3 changed files with 10 additions and 2 deletions
|
@ -63,4 +63,10 @@
|
|||
assert:
|
||||
that:
|
||||
- "file_result.changed != True"
|
||||
|
||||
|
||||
# VERIFY STRING TEMPLATE PRESERVES NEWLINE
|
||||
|
||||
- name: ensure template strings preserve newline
|
||||
assert:
|
||||
that:
|
||||
- "newline_no_template_string == newline_template_string"
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
templated_var: templated_var_loaded
|
||||
newline_template_string: "Hello {{ 'World' }}\n"
|
||||
newline_no_template_string: "Hello World\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue