I want to template .yaml
files with ansible. This is a standard job, I assumed, but then I realized that the template module is unable to produce valid integers in the YAML output.
Given an inventory var bar
is set to 1
, using the following template:
foo: "{{ bar | int }}"
and a very basic playbook, just doing the template. Doing so, I end up with
foo: "1"
in the resulting .yaml file which is wrong. According to the docs, the result should be
foo: 1
I am using ansible 2.10.5
What is the problem here?