Hello,
I would like to discuss the idea for a hierarchic structure for the inventory. Would it possible to support something like that?
For example with this structure:
| server
| -- atlanta
| `-- web
| `--hosts:web1
| -- raleigh
| `-- web
| `-- host:web2
You would need this config:
{
"web" : { "hosts": [ "web1", "web2" ] },
"server" : { "hosts": [ "web1", "web2" ] },
"atlanta" : { "hosts": [ "web1" ] },
"raleigh" : { "hosts": [ "web2" ] }
}
To work with "children" the group names would have to be unique in the whole tree. So "web" would break this up.
Wouldn't it be nice to use something like that?
{
"server"
{ "atlanta" { "web" {"hosts": [ "web1" ] } } },
{ "raleigh" { "web" {"hosts": [ "web2" ] } } }
}
I came up with this by using a KeePass database as inventory source:
https://github.com/escoreal/ansible_kdb_inventoryHere I have to build the tree for each host and add it to all parents. But this doesn't scale to well.
Thanks,
esco