during the last couple of days I was thinking about how to structure multiple systems with groups and child-groups .
In my view, maybe there are two ways how to solve it. You can group by logical/physical location (all systems on one base-machine), or you can differ between the services running on systems (e.g. webserver-systems, vm-basis etc.).
Actually this is fine, if you use ansible without DebOps. But actually I would like to use DebOps ;) and this leads me to an unexpected behavior.
The possibility to provide groups variables which will be combined with host variables are really nice, if you need to specify more details host configurations. But the situation, that a host can be part of multiple groups and every group can have special configuration does not well.
HostA is part of GroupA und GroupB. If you specify apt_install 'apt_install__group_packages' for both groups in 'inventory/groups_vars/', there is no combination and no easy way to find out, which 'apt_install__group_packages' are taken. Furthermore there is no easy way to determine what are all group_vars, which will be are relevant for a hosts, maybe to detect variable-collisions.
Now I am wondering, what are your 'best practices' to manage your groups/group_vars. Are you only using groups_vars for services and never for locations. But how will you even handle this problem there. What if your systems are base machine, which are in group [debops_service_libvirtd] and you want to additionally install libvirt extensions with 'apt_install' and parallel the same systems are in [debops_service_mount] and you want to 'apt_install' extensions there too.
best and thanks for any conversation : )