Skip to content

Commit

Permalink
Don't assume groups[concourseci_web_group] exist (#55)
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
jschaul authored and ahelal committed Nov 10, 2017
1 parent b11aac0 commit c82a825
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c82a825

Please sign in to comment.