Ansible dash(hyphen) parsing from json

Finally, you realized that Ansible not reads your variable name1 well and makes problem while working. After that problem, you used Google efficiently and boom it’s my blog page you are good Developer.

This is quick post which is going to solve your problem 🙂

As you know Ansible uses YAML, In that format, is really important you can create lists and loops etc. So that reason it’s not good to create a variable name with a dash.


While working with Ansible, it’s easy to reach the value of a nested variable by using "{{ someoutput.variable.anotherone }}"  as in any programming language. Problem starts with reaching JSON object which has – in variable

It’s not possible to reach normal way if have like that JSON object

Handling that object is not easy like output.some-variable.anotherone  that gives error you have to use

Sorry but, you fixed your problem and that was not the real one 🙂