summaryrefslogtreecommitdiffstats
path: root/roles/openshift_cloud_provider/tasks/gce.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_cloud_provider/tasks/gce.yml')
-rw-r--r--roles/openshift_cloud_provider/tasks/gce.yml20
1 files changed, 18 insertions, 2 deletions
diff --git a/roles/openshift_cloud_provider/tasks/gce.yml b/roles/openshift_cloud_provider/tasks/gce.yml
index ee4048911..8b9c1b42a 100644
--- a/roles/openshift_cloud_provider/tasks/gce.yml
+++ b/roles/openshift_cloud_provider/tasks/gce.yml
@@ -1,4 +1,14 @@
---
+- name: check variables are passed
+ fail:
+ msg: "Ensure correct variables are defined for gcp. {{ item.name }}"
+ when: item.value == ''
+ with_items:
+ - name: openshift_gcp_project
+ value: "{{ openshift_gcp_project }}"
+ - name: openshift_gcp_prefix
+ value: "{{ openshift_gcp_prefix }}"
+
# Work around ini_file create option in 2.2 which defaults to no
- name: Create cloud config file
file:
@@ -13,5 +23,11 @@
ini_file:
dest: "{{ openshift.common.config_base }}/cloudprovider/gce.conf"
section: Global
- option: multizone
- value: "true"
+ 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: '{{ openshift_gcp_multizone | string }}' }