From 744345f737c236d44d42237ab18aa3678d06b44d Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Sun, 12 Nov 2017 17:49:02 +0000
Subject: [PATCH] Allow for non-existent groups in kolla-ansible top level
 group mapping

This allows us to add groups (such as compute) to the top level group mapping,
which are not present in an existing inventory.
---
 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 0d213eb3..d540371c 100644
--- a/ansible/roles/kolla-ansible/templates/overcloud-top-level.j2
+++ b/ansible/roles/kolla-ansible/templates/overcloud-top-level.j2
@@ -15,7 +15,7 @@
 # Top level {{ group }} group.
 [{{ group }}]
 # These hostnames must be resolvable from your deployment host
-{% for host in groups[group] %}
+{% for host in groups.get(group, []) %}
 {% set host_hv=hostvars[host] %}
 {{ host }}{% for hv_name in kolla_overcloud_inventory_pass_through_host_vars %}{% if hv_name in host_hv %} {{ hv_name }}={{ host_hv[hv_name] }}{% endif %}{% endfor %}
 
-- 
GitLab