summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-02-02 08:38:49 -0800
committerGitHub <noreply@github.com>2018-02-02 08:38:49 -0800
commit28ed642adcb9d7e79d73410ae1d194aae9946ec0 (patch)
treedc83d65a1df93f8eb085c29358542bd9183d4795
parentd057d39e81432b8a7906df8b1f3101b6239c343e (diff)
parent6a1c9d2af8dd5f85f653c188c58234fe3edfa064 (diff)
downloadopenshift-28ed642adcb9d7e79d73410ae1d194aae9946ec0.tar.gz
openshift-28ed642adcb9d7e79d73410ae1d194aae9946ec0.tar.bz2
openshift-28ed642adcb9d7e79d73410ae1d194aae9946ec0.tar.xz
openshift-28ed642adcb9d7e79d73410ae1d194aae9946ec0.zip
Merge pull request #6976 from kwoodson/bz1538581
Automatic merge from submit-queue. Adding defaults for the gcp variables to fix an undefined ansible exception. Fix for bz: https://bugzilla.redhat.com/show_bug.cgi?id=1538581 Default variables for gcp. Check to ensure defaults are set to something other than '' to ensure this works.
-rw-r--r--roles/openshift_cloud_provider/defaults/main.yml4
-rw-r--r--roles/openshift_cloud_provider/tasks/gce.yml18
2 files changed, 17 insertions, 5 deletions
diff --git a/roles/openshift_cloud_provider/defaults/main.yml b/roles/openshift_cloud_provider/defaults/main.yml
new file mode 100644
index 000000000..37cbf5603
--- /dev/null
+++ b/roles/openshift_cloud_provider/defaults/main.yml
@@ -0,0 +1,4 @@
+---
+openshift_gcp_project: ''
+openshift_gcp_prefix: ''
+openshift_gcp_network_name: "{{ openshift_gcp_prefix }}network"
diff --git a/roles/openshift_cloud_provider/tasks/gce.yml b/roles/openshift_cloud_provider/tasks/gce.yml
index 395bd304c..9e1c31b1d 100644
--- a/roles/openshift_cloud_provider/tasks/gce.yml
+++ b/roles/openshift_cloud_provider/tasks/gce.yml
@@ -1,4 +1,12 @@
---
+- name: check variables are passed
+ fail:
+ msg: "Ensure correct variables are defined for gcp. {{ item }}"
+ when: item == ''
+ with_items:
+ - "{{ openshift_gcp_project }}"
+ - "{{ openshift_gcp_prefix }}"
+
# Work around ini_file create option in 2.2 which defaults to no
- name: Create cloud config file
file:
@@ -16,8 +24,8 @@
option: "{{ item.key }}"
value: "{{ item.value }}"
with_items:
- - { key: 'project-id', value: '{{ openshift_gcp_project }}' }
- - { key: 'network-name', value: '{{ openshift_gcp_network_name }}' }
- - { key: 'node-tags', value: '{{ openshift_gcp_prefix }}ocp' }
- - { key: 'node-instance-prefix', value: '{{ openshift_gcp_prefix }}' }
- - { key: 'multizone', value: 'false' }
+ - { key: 'project-id', value: '{{ openshift_gcp_project }}' }
+ - { key: 'network-name', value: '{{ openshift_gcp_network_name }}' }
+ - { key: 'node-tags', value: '{{ openshift_gcp_prefix }}ocp' }
+ - { key: 'node-instance-prefix', value: '{{ openshift_gcp_prefix }}' }
+ - { key: 'multizone', value: 'false' }