From 0c190a22f0f50385f598fa92d6962842bd9b96eb Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Thu, 17 Mar 2022 16:34:54 +0100 Subject: [PATCH] Fix Ansible inventory generation when reusing group names When a kolla-ansible group is composed of a kayobe group with the same name and of at least one other kayobe group, kayobe would generate an invalid Ansible inventory such as: [compute:children] controllers compute Because the top-level group should already be defined, we only need to add as children the kayobe groups using different names. Change-Id: I88bdf1e3d0c08271ac8938ae2f9ac3f9fee1efa5 Story: 2009927 Task: 44798 --- .../roles/kolla-ansible/templates/overcloud-top-level.j2 | 2 +- .../fix-kolla-ansible-group-mapping-8fcd6cbb1e744e18.yaml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-kolla-ansible-group-mapping-8fcd6cbb1e744e18.yaml diff --git a/ansible/roles/kolla-ansible/templates/overcloud-top-level.j2 b/ansible/roles/kolla-ansible/templates/overcloud-top-level.j2 index da8fcd668..26953081f 100644 --- a/ansible/roles/kolla-ansible/templates/overcloud-top-level.j2 +++ b/ansible/roles/kolla-ansible/templates/overcloud-top-level.j2 @@ -36,7 +36,7 @@ ansible_python_interpreter={{ kolla_ansible_target_venv }}/bin/python # Mapping from kolla-ansible group {{ kolla_group }} to top level kayobe # groups. [{{ kolla_group }}:children] -{% for group in kolla_group_config.groups %} +{% for group in renamed_groups %} {{ group }} {% endfor %} diff --git a/releasenotes/notes/fix-kolla-ansible-group-mapping-8fcd6cbb1e744e18.yaml b/releasenotes/notes/fix-kolla-ansible-group-mapping-8fcd6cbb1e744e18.yaml new file mode 100644 index 000000000..08fa49bc6 --- /dev/null +++ b/releasenotes/notes/fix-kolla-ansible-group-mapping-8fcd6cbb1e744e18.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes Ansible inventory generation with some custom group mappings using + the same group names for Kayobe and Kolla Ansible. See `story 2009927 + `__ for details.