I realize this is an old thread, but why does this not work? It works as expected for arrays...
For instance see this blog post: http://adamj.eu/tech/2014/10/02/merging-groups-and-hostvars-in-ansible-variables/ That works just fine, but if you try to modify this to output an array of dictionaries, or similar, ansible doesn't interpret the result correctly. Why? On Thursday, October 23, 2014 at 12:29:42 PM UTC-4, James Cammarata wrote: > > Hi Anth, > > Unfortunately, this cannot be done the way you're trying it. You're > creating YAML after the YAML structure is already parsed, so the variable > is just storing it as a string. > > Instead of doing this, I would recommend using the add_host module ( > http://docs.ansible.com/add_host_module.html), which can also accept any > additional variables you may wish to associate with that host entry. > > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/610b4345-f4ca-4c00-8046-588b1693d9a8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
