From c82a825720757cb519039d14457f4adf082f7580 Mon Sep 17 00:00:00 2001 From: jschaul Date: Fri, 10 Nov 2017 09:46:55 +0100 Subject: [PATCH] Don't assume groups[concourseci_web_group] exist (#55) Current code fails if there are no hosts in the concourseci_web_group (when e.g. applying this playbook only to worker hosts). This holds true even if specifying a concourse_web_options/CONCOURSE_TSA_HOST. This change gives a default list with one element as the second argument to `.get` --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 1099e35..b6c5af5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -31,7 +31,7 @@ concourse_web_options : { } concourse_web_options_default : CONCOURSE_BIND_IP : "0.0.0.0" - CONCOURSE_TSA_HOST : "{{ groups[concourseci_web_group][0] | default('') }}" # By default we pick the first host in web group + CONCOURSE_TSA_HOST : "{{ groups.get(concourseci_web_group, [''])[0] }}" # By default we pick the first host in web group CONCOURSE_TSA_BIND_IP : "0.0.0.0" CONCOURSE_TSA_BIND_PORT : "2222" CONCOURSE_TSA_AUTHORIZED_KEYS : "{{ concourseci_ssh_dir }}/tsa_authorization"