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
Integer variables are converted to strings when referenced in other variables #18095
Labels
Comments
This seems to be a bug in how the output is shown. The variables themselves dont seem to end up as string types: ---
- hosts: localhost
gather_facts: no
vars:
some_integer: 5
some_other_integer: "{{ some_integer }}"
tasks:
- debug: var=some_integer
- debug: var=some_other_integer
- name: assert some_integer and some_other_integer is an int 5 and not a string "5"
assert:
that:
- some_integer == 5
- some_other_integer == 5
- name: assert some_int is not a string
assert:
that:
- some_integer != "5"
- some_other_integer != "5"
|
Duplicate of #17992 (comment) |
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 |
Integers are evil! |
Some integers are more evil than others. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
ISSUE TYPE
COMPONENT NAME
Variables
ANSIBLE VERSION
CONFIGURATION
No changes
OS / ENVIRONMENT
macOS Sierra (10.12)
SUMMARY
Variables defined as integers (without quotes) are converted to strings when using them in the definition of another variable.
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: