From 86eb21dd988b180d2dcbcc1c823c8c7c18672b59 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Thu, 22 Aug 2019 16:30:56 +0100 Subject: [PATCH] Don't assume etcd group exists in baremetal role The baremetal role does not currently assume too much about the inventory, and in kayobe the seed is deployed using a very minimal inventory. Icf3f01516185afb7b9f642407b06a0204c36ecbe added a reference to the etcd group in the baremetal role, which causes kayobe seed deployment to fail with the following error: AnsibleUndefinedVariable: 'dict object' has no attribute 'etcd' This change defaults the group lookup to an empty list. Change-Id: Ib3252143a97652c5cf70b56cbfd7c7ce69f93a55 Closes-Bug: #1841073 (cherry picked from commit 331d373b996d9e7b7f9e6d9a1fa48821ddf1d62b) --- ansible/group_vars/all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index d4507d6f40..86bf514805 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -107,7 +107,7 @@ docker_restart_policy_retry: "10" # Extra docker options for Zun docker_configure_for_zun: "no" -docker_zun_options: -H fd:// -H tcp://{{ api_interface_address }}:2375 --cluster-store=etcd://{% for host in groups['etcd'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ hostvars[host]['etcd_client_port'] }}{% if not loop.last %},{% endif %}{% endfor %} +docker_zun_options: -H fd:// -H tcp://{{ api_interface_address }}:2375 --cluster-store=etcd://{% for host in groups.get('etcd', []) %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ hostvars[host]['etcd_client_port'] }}{% if not loop.last %},{% endif %}{% endfor %} # Common options used throughout Docker docker_common_options: