diff options
author | Rodolfo Carvalho <rhcarvalho@gmail.com> | 2017-06-12 11:49:02 +0200 |
---|---|---|
committer | Rodolfo Carvalho <rhcarvalho@gmail.com> | 2017-06-12 11:49:02 +0200 |
commit | 29995105c0143505a51b3c1102a3eadc60b46318 (patch) | |
tree | a43e7e376b6ec7ff08ef8614f757cb8a0941a188 | |
parent | dc12c4b28321e944b2fd3a35241510fd6513fcae (diff) | |
download | openshift-29995105c0143505a51b3c1102a3eadc60b46318.tar.gz openshift-29995105c0143505a51b3c1102a3eadc60b46318.tar.bz2 openshift-29995105c0143505a51b3c1102a3eadc60b46318.tar.xz openshift-29995105c0143505a51b3c1102a3eadc60b46318.zip |
Fix possible access to undefined variable
g_glusterfs_hosts is verified to be defined in the beginning of the
playbook.
g_glusterfs_registry_hosts is only defined when
playbooks/byo/openshift-cluster/cluster_hosts.yml is loaded, which seems
to not always be the case.
Instead of trying to find all entrypoints where cluster_hosts should be
loaded to defined the variable, simply use the `default()` filter to
consider it empty when not defined.
-rw-r--r-- | playbooks/common/openshift-cluster/evaluate_groups.yml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/playbooks/common/openshift-cluster/evaluate_groups.yml b/playbooks/common/openshift-cluster/evaluate_groups.yml index 46932b27f..c28ce4c14 100644 --- a/playbooks/common/openshift-cluster/evaluate_groups.yml +++ b/playbooks/common/openshift-cluster/evaluate_groups.yml @@ -155,5 +155,5 @@ groups: oo_glusterfs_to_config ansible_ssh_user: "{{ g_ssh_user | default(omit) }}" ansible_become: "{{ g_sudo | default(omit) }}" - with_items: "{{ g_glusterfs_hosts | union(g_glusterfs_registry_hosts) | default([]) }}" + with_items: "{{ g_glusterfs_hosts | union(g_glusterfs_registry_hosts | default([])) }}" changed_when: no |