summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Hanselmann <hansmi@vshn.ch>2017-10-04 12:10:02 +0200
committerMichael Hanselmann <hansmi@vshn.ch>2017-10-19 11:02:08 +0200
commitb2df9cc2d5b16a1b1e59d77244e10762e48d72ed (patch)
treec1dec6e793ae553289f27c0fdbdc24484660ab12
parent64f452f9081e380db41acf588a28fe4bb79a4e9e (diff)
downloadopenshift-b2df9cc2d5b16a1b1e59d77244e10762e48d72ed.tar.gz
openshift-b2df9cc2d5b16a1b1e59d77244e10762e48d72ed.tar.bz2
openshift-b2df9cc2d5b16a1b1e59d77244e10762e48d72ed.tar.xz
openshift-b2df9cc2d5b16a1b1e59d77244e10762e48d72ed.zip
Avoid undefined variable in master sysconfig template
When "openshift_master_controllers_env_vars" is set, but "openshift_master_api_env_vars" isn't, the template for the sysconfig file of atomic-openshift-master fails: AnsibleUndefinedVariable: 'dict object' has no attribute 'api_env_vars' Avoid this issue by applying "default({})" to the dict and always calling ".items()".
-rw-r--r--roles/openshift_master/templates/atomic-openshift-master.j22
1 files changed, 1 insertions, 1 deletions
diff --git a/roles/openshift_master/templates/atomic-openshift-master.j2 b/roles/openshift_master/templates/atomic-openshift-master.j2
index 7ec26ceb7..3f7a528a9 100644
--- a/roles/openshift_master/templates/atomic-openshift-master.j2
+++ b/roles/openshift_master/templates/atomic-openshift-master.j2
@@ -21,7 +21,7 @@ AWS_SECRET_ACCESS_KEY={{ openshift_cloudprovider_aws_secret_key }}
{% endif %}
{% if 'api_env_vars' in openshift.master or 'controllers_env_vars' in openshift.master -%}
-{% for key, value in openshift.master.api_env_vars.items() | default([]) | union(openshift.master.controllers_env_vars.items() | default([])) -%}
+{% for key, value in (openshift.master.api_env_vars | default({})).items() | union((openshift.master.controllers_env_vars | default({})).items()) -%}
{{ key }}={{ value }}
{% endfor -%}
{% endif -%}