From 22c155349f8b45cea6eaa655ae52116630959c7c Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Fri, 25 May 2018 12:27:46 +0100 Subject: [PATCH] Fix empty kolla_overcloud_inventory_storage_groups In some cases we may have a kolla group defined in 'kolla_overcloud_inventory_top_level_group_map' which has no kayobe groups mapped to it. This causes no entry to be added to the inventory for the group. If the group is referenced elsewhere in the inventory, then Ansible will fail to parse the inventory file. The specific case that failed was when setting 'kolla_overcloud_inventory_storage_groups' to an empty list. This change ensures that we add an empty definition for the group in the kolla inventory. Change-Id: I8e797aa6c55f8cf0cf6d52a33f213d8131581fea Story: 2002105 Task: 19783 --- ansible/roles/kolla-ansible/templates/overcloud-top-level.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/kolla-ansible/templates/overcloud-top-level.j2 b/ansible/roles/kolla-ansible/templates/overcloud-top-level.j2 index 50a2e6a3b..25379f8c8 100644 --- a/ansible/roles/kolla-ansible/templates/overcloud-top-level.j2 +++ b/ansible/roles/kolla-ansible/templates/overcloud-top-level.j2 @@ -60,7 +60,7 @@ ansible_python_interpreter={{ kolla_ansible_target_venv }}/bin/python {% endif %} {% endfor %} {% for group in kolla_overcloud_inventory_kolla_top_level_groups %} -{% if group not in kolla_overcloud_inventory_top_level_group_map %} +{% if not kolla_overcloud_inventory_top_level_group_map.get(group, {}).get('groups') %} # Empty group definition for {{ group }}. [{{ group }}]