You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello community. I want to submit the following issue for the inventory plugin. While I am looking for devices to be grouped by the region in which it's site is located, I expect to have inventory groups (regions) being populated with hosts (devices). Instead I see all the possible sites flattened as child groups of the main groups (defined by regions). It is rather problematic as even empty groups (sites) without devices (based on the filter applied to the query) are cluttering the overall view of groups. I have almost 600 sites and it does not see all of them as groups here. Otherwise, if I needed it, I would have chosen group_by: sites.
I see the issue in the main() function definition where the following condition is set:
if (
site_group_by in self.group_by
or "location" in self.group_by
or "region" in self.group_by
or "site_group" in self.group_by
):
self._add_site_groups()
this is immediately followed by:
# Create groups for regions, containing the site groups
if "region" in self.group_by:
self._add_region_groups()
The point here should not be to add site groups to the regions though. Especially while I am looking to create a device inventory.
I understand that we have to extract site from the device and than get the region from the site, this is why in my opinion we need to rewrite _add_region_group() and not treat group_by: region to look first for all the available sites. The possible approach could be to find sites which has devices we are looking for. Subsequently, for each of these sites, find a region and assign host to it as a group.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello community. I want to submit the following issue for the inventory plugin. While I am looking for devices to be grouped by the region in which it's site is located, I expect to have inventory groups (regions) being populated with hosts (devices). Instead I see all the possible sites flattened as child groups of the main groups (defined by regions). It is rather problematic as even empty groups (sites) without devices (based on the filter applied to the query) are cluttering the overall view of groups. I have almost 600 sites and it does not see all of them as groups here. Otherwise, if I needed it, I would have chosen group_by: sites.
I see the issue in the main() function definition where the following condition is set:
this is immediately followed by:
The point here should not be to add site groups to the regions though. Especially while I am looking to create a device inventory.
I understand that we have to extract site from the device and than get the region from the site, this is why in my opinion we need to rewrite _add_region_group() and not treat group_by: region to look first for all the available sites. The possible approach could be to find sites which has devices we are looking for. Subsequently, for each of these sites, find a region and assign host to it as a group.
Beta Was this translation helpful? Give feedback.
All reactions