Jonathan Rosser c76a4d5dfe Do not create {hostname}-host_containers group as child of other groups
The existing code adds entries like aio1-host_containers as a child group
of many other container type groups in the inventory.

The side effect is that the ansible magic variable group_names for
a particular LXC container lists many group names associated with
all of the containers on its physical host.

Roles such as os_ironic create several containers and use conditional
logic to deploy the correct components into each container using the
contents of group_names. This does not work correctly when group_names
contains all of the possible ironic container groups.

This patch removes the code which adds host container groups as
children of other container type groups.

Removal of the {hostname}-host_containers group from each container
reveals a further bug, where any belongs_to directives in env.d
file container_skel sections were not processed. There is different
functionality in skel_load() and container_skel_load() which is the
cause of this.

This patch adds a call to _parse_belongs_to() into
container_skel_load() so that any groups defined with 'belongs_to'
in container_skel are correctly added as children to the
corresponding parent group.

Change-Id: Ic76b2c211484fb107d8d23f4ef6e6cc9a4ddec4f
2022-08-02 21:06:20 +00:00
..
2020-04-29 06:20:40 +00:00
2021-06-18 08:35:55 +00:00