diff options
author | Jacob Leverich <leverich@gmail.com> | 2014-07-14 13:36:17 -0700 |
---|---|---|
committer | Jacob Leverich <leverich@gmail.com> | 2014-07-14 13:36:17 -0700 |
commit | 7a8eb0b6701e437cb18b9b3a540dbac9aef9db26 (patch) | |
tree | db7f9e8b1acf3a450f3f8b04a76f633adb6cce46 /test | |
parent | 7c6175e78033a0bc9f242272baa36ec49d3e3585 (diff) | |
download | ansible-7a8eb0b6701e437cb18b9b3a540dbac9aef9db26.tar.gz |
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.
Diffstat (limited to 'test')
-rw-r--r-- | test/integration/roles/test_template/tasks/main.yml | 8 | ||||
-rw-r--r-- | test/integration/roles/test_template/vars/main.yml | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/test/integration/roles/test_template/tasks/main.yml b/test/integration/roles/test_template/tasks/main.yml index 4784dc6ac8..8dcb0b47cf 100644 --- a/test/integration/roles/test_template/tasks/main.yml +++ b/test/integration/roles/test_template/tasks/main.yml @@ -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" diff --git a/test/integration/roles/test_template/vars/main.yml b/test/integration/roles/test_template/vars/main.yml index 1e8f64ccf4..88503a22ca 100644 --- a/test/integration/roles/test_template/vars/main.yml +++ b/test/integration/roles/test_template/vars/main.yml @@ -1 +1,3 @@ templated_var: templated_var_loaded +newline_template_string: "Hello {{ 'World' }}\n" +newline_no_template_string: "Hello World\n" |