I just finished a python program to query our mysql inventory.
when I do python getinv.py --list, i can see the json output. And ‘ansible us-east-1_app1 --list-hosts’ works as well.
The only problem is it also displays the group name in the output. This affects when I check say uptime - ssh says not able to ssh to the group name.
eg,
$>ansible us-east-1_app1 --list-hosts
us-east-1_app1
app000ea2
app002ea1
Any idea why ansible also gets the group name?
Here is the json part…
When creating a dynamic inventory plugin, if you don’t intend on actually putting hosts directly in the group, you still need to include the ‘hosts’ key to the group with an empty list.