New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jinja2 templates can only yield strings #18722
Comments
Hi,
|
(Mentioning #17992 here to keep track of related issues) |
There is a light at the end of the tunnel. We made a change to Jinja2 so we don't see all variable types changed into strings. See: pallets/jinja#708 |
This behavior can be altered with the following config option (turned off by default) https://docs.ansible.com/ansible/devel/reference_appendices/config.html#default-jinja2-native which will be included in the |
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
OS / ENVIRONMENT
N/A (assumed. Only tested on macOS)
SUMMARY
You can't have non-string variables as the result of arithmetic/filters/etc in jinja2 templates
STEPS TO REPRODUCE
Consider a playbook and a vars file:
EXPECTED RESULTS
I would have expected all four numbers to appear unquoted, as follows (abridged):
ACTUAL RESULTS
Instead, the last two numbers are quoted, as follows (abridged):
The text was updated successfully, but these errors were encountered: