YAML variable without using quotes?

I’m hitting this error:

We could be wrong, but this one looks like it might be an issue with

missing quotes. Always quote template expression brackets when they

start a value. For instance:

with_items:

  • {{ foo }}

Should be written as:

with_items:

  • “{{ foo }}”

The problem is that I’m converting the YAML to JSON, and I need the value (a number) to be unquoted in the JSON.

Is there any way I can avoid this error without quoting, or is there some way to remove the quotes when it’s converted to JSON?

“{{foo|int}}” should return a number

No, I’m still seeing the value being quoted:

instances: “{{ groups[‘workers’]|count|int }}”
becomes:
“instances”: “3”,

what version of ansible?

ansible 1.9.0.1

that is a bug in that version, it should work on 2.0 and above

I’m still seeing the same issue on Ansible 2.0.0.2.

Brian, can you point me to the commit that should be fixing this bug?

Thanks!

I’m still seeing a repro of the bug. Is this the commit you’re referring to?
https://github.com/ansible/ansible/pull/10465

For this bug?
https://github.com/ansible/ansible/issues/9362