diego-treitos / ansible-inventory

Script to manage your Ansible Inventory and also can be used by ansible as a dynamic inventory source

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

show hosts and "groups of groups"

rokas-tc opened this issue · comments

Hello,

Lets say we have a following structure:

add host host1
add group child_group
add group parent_group
add host host1 to_groups=child_group
add group child_group to_groups=parent_group

At this point "show hosts host1" returns that host1 is a member of child_group only - skipping the fact that it also belongs to parent_group indirectly.

I believe it would be beneficial to see all the groups (and maybe even vars) specific hosts inherits from parent groups.

br,

Hi. I am glad to see that I am not the only one using this :)

I am not sure about the functionality you suggest. I think the output of show host host1 may become messy or confusing. I'd prefer to keep it as simple as possible.

Also it is not so simple to show parent groups because, unless I am mistaken, a group can belong to several groups.

[atlanta]
host1
host2

[raleigh]
host2
host3

[southeast:children]
atlanta
raleigh

[externalcpds:children]
raleigh

So in this case, who is the raleigh parent? And this is still a simple case (it only has 2 parents and what if their parents have also multiple parents?) and it is only for a single group.

As you can see, the representation of the group hierarchy can get very complicated. I don't know if there is any other tool that shows the information in some easy way to understand. If there is I could take a look to have an idea.