Changed with/endwith behavior when passing variables to included template #81852
Labels
affects_2.15
bug
This issue/PR relates to a bug.
module
This issue/PR relates to a module.
verified
This issue has been verified/reproduced by maintainer
Summary
I'm not really sure if it's bug or feature. I'm also not really sure what cause this - Ansible itself, Jinja or Python. There's some changed behavior in templates when using include expression together with with/endwith block.
Variable:
camel_activemq_pool_max_connections: 50
Main template:
Included template:
Result on Amazon Linux 2023:
Result on Rocky Linux 8:
The differences we observe:
{{ }}
markers are interpreted differently insidewith/endwith
block - on Rocky Linux 8 they are interpreted as part of string.raw/endraw
block is also interpreted as part of string.Issue Type
Bug Report
Component Name
template
Ansible Version
Configuration
OS / Environment
Recent releases of:
Steps to Reproduce
To generate file using the templates from the description.
Expected Results
Not sure what should be the expected result, I mean which version generates file correctly. Personally I prefer the Amazon Linux 2023 option (despite it requires refactoring of our templates). In general, I expect consisted behavior between versions. What's interesting, both setups use the same Jinja versions. Ansible and Python are different.
Actual Results
Described in the summary.
Code of Conduct
The text was updated successfully, but these errors were encountered: