Hello!

I'm new to ansible, and I am trying to figure out how the json output 
should look like if I have a flat-file inventory source like:

# application:environment=hostlist
heroes:marvel=thor hulk stark cap
heroes:dc=supe bats flash robin
colors:primary=red blue yellow
colors:secondary:green orange violet

lol:~/scripts/python bash-3.2$ ./inv.py --list
{
    "heroes": {
        "dc": [
            "supe",
            "bats",
            "flash",
            "robin"
        ],
        "marvel": [
            "thor",
            "hulk",
            "stark",
            "cap"
        ]
    },
    "colors": {
        "primary": [
            "red",
            "blue",
            "yellow"
        ],
        "secondary": [
            "green",
            "orange",
            "violet"
        ]
    }
}

I am looking to run one liners against groups and sub groups such as:
 
ansible -i ~/bin/inv.py colors -m 'uname -n'
(runs uname against red, blue, yellow, green, orange, violet)

ansible -i ~/bin/inv.py primary -m 'uname -n'
(runs uname against green, orange, violet)

Or, I could be going about this all wrong. Can anyone give me a hint? 

cheers,
Marc


-- 
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/1567b709-74ca-47b9-a884-8eba6634b8b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to