diff options
author | Kenny Woodson <kwoodson@redhat.com> | 2018-02-01 10:16:43 -0500 |
---|---|---|
committer | Kenny Woodson <kwoodson@redhat.com> | 2018-02-01 16:20:38 -0500 |
commit | 6a1c9d2af8dd5f85f653c188c58234fe3edfa064 (patch) | |
tree | 2f20486c297563e40c6d81c9255d44e1ac8d0828 /roles | |
parent | 8d2f2d7820b5c238f4723e4eade3882ca7332685 (diff) | |
download | openshift-6a1c9d2af8dd5f85f653c188c58234fe3edfa064.tar.gz openshift-6a1c9d2af8dd5f85f653c188c58234fe3edfa064.tar.bz2 openshift-6a1c9d2af8dd5f85f653c188c58234fe3edfa064.tar.xz openshift-6a1c9d2af8dd5f85f653c188c58234fe3edfa064.zip |
Adding defaults for the gcp variables to fix an undefined ansible exception.
Diffstat (limited to 'roles')
-rw-r--r-- | roles/openshift_cloud_provider/defaults/main.yml | 4 | ||||
-rw-r--r-- | roles/openshift_cloud_provider/tasks/gce.yml | 18 |
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' } |