diff --git a/ansible/roles/kolla-ansible/templates/overcloud-top-level.j2 b/ansible/roles/kolla-ansible/templates/overcloud-top-level.j2
index 0d213eb3eea2e74307b517164ae7afb454458033..d540371c596fd13df8504bb4355ad35a1b5db35f 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 %}