osism / container-image-kolla-ansible

Container image which contains Ansible playbooks for deployment of OpenStack
https://www.osism.tech
Apache License 2.0
4 stars 6 forks source link

Inventory default groups merge with user defined inventory groups #140

Closed grawert closed 3 years ago

grawert commented 3 years ago

Defining group membership in custom inventory files does not overwrite existing default group memberships. Instead Ansible is merging them. Leaving the user no option to definitely define group memberships.

The organization of default group memberships should be reorganized. So that overwriting is still possible for the user.

MalatuS commented 3 years ago

According to ansible this is default behavior as groups will be merged and only matching variables will be overwritten by order See also documentation

I'd suggest to remove default entries for openstack components as you apparently have no way of using a subset of an already allocated group, no matter the presedence.

Example:

[control]
host[02:06:2]

[network]
host[01:06]

in 50-kolla:

[octavia]
control

in 51-kolla:

[octavia-health-manager:children]
network

[octavia-housekeeping:children]
network

[octavia-worker:children]
network

In this example octavia-* will always be located on all network nodes, which might not be intended. Currently a subset of network could only be realised with something like that:

[network]

[network1]
host[01:05:2]

[network2]
host[02:06:2]

And then extra files for service-specific components; 30-neutron

[neutron]
network1
network2
...

Or manipulate the 50-kolla and 51-kolla default files inside the container. Maybe the default fill can be made switchable to allow granularly setting values if needed or use default if not?

berendt commented 3 years ago

The current approach with numbered inventory files does not work at all, right. I will investigate a script based solution to get rid of this Ansible limitation. A solution should be available during this week.