I have a task that I am scratching my head on, and my google foo is just 
getting some really basic examples of the COPY - CONTENT method of writing 
a file.

my variable returned from the URI module is data, which is a 4 variable 
JSON array. data.json.devices is the list I want to dump to a file to use 
as my future hosts file for cli config operations.

ok: [localhost] => {
    "msg": [
        {
            "hostname": "host1", 
            "id": "0093253e", 
            "mgmtIP": "10.10.10.1"
        }, 
        {
            "hostname": "host2", 
            "id": "00e75962", 
            "mgmtIP": "10.10.10.8"
        }, 
<snip the other 378 entries in list>

I'd like to spit this to a ./inventory/hosts file in a format that my 
playbook can then use in the next set of tasks. So just the "hostname" and 
"mgmtIP" variables written to a line.

How might that look?

Nick



-- 
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/533b0316-afbd-461e-a0d9-0c20416252c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to