Stop ignoring hostnames without underscores

The inventory management script was ignoring hostnames without underscores,
which lends its roots to all LXC containers having underscores. In bare
metal deployments, hosts likely won't have underscores, and new containers
might even have hyphens. Group listing now works as expected.

Change-Id: Ied031501bc1da4d1a3c4f9ad101aba355ecd364f
This commit is contained in:
James Denton 2023-10-11 13:53:37 -05:00
parent c8a460b395
commit 934817b8f9

View File

@ -120,10 +120,6 @@ def get_all_groups(inventory):
containers = {}
for container_name in inventory['_meta']['hostvars'].keys():
# Skip the default group names since they're not helpful (like aio1).
if '_' not in container_name:
continue
groups = get_groups_for_container(inventory, container_name)
containers[container_name] = groups