summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-11-07 07:46:45 -0500
committerGitHub <noreply@github.com>2016-11-07 07:46:45 -0500
commitb97196e3319c5ec00fdd9998aba51b4877d3ada9 (patch)
tree1c45a67bca0441da9f5bc1b34bc57d68014948f7 /roles
parent4698b0c696b9d9cf2b8dbff5eaa4fcaa545093cd (diff)
parent2659a4f891d22dd820bd30f8d3b1dbd8793abb7a (diff)
downloadopenshift-b97196e3319c5ec00fdd9998aba51b4877d3ada9.tar.gz
openshift-b97196e3319c5ec00fdd9998aba51b4877d3ada9.tar.bz2
openshift-b97196e3319c5ec00fdd9998aba51b4877d3ada9.tar.xz
openshift-b97196e3319c5ec00fdd9998aba51b4877d3ada9.zip
Merge pull request #2728 from sjenning/fix-gce-multizone
default to multizone GCE config
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_cloud_provider/tasks/gce.yml16
-rw-r--r--roles/openshift_cloud_provider/tasks/main.yml3
-rw-r--r--roles/openshift_cloud_provider/vars/main.yml1
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py3
4 files changed, 23 insertions, 0 deletions
diff --git a/roles/openshift_cloud_provider/tasks/gce.yml b/roles/openshift_cloud_provider/tasks/gce.yml
new file mode 100644
index 000000000..14ad8ba94
--- /dev/null
+++ b/roles/openshift_cloud_provider/tasks/gce.yml
@@ -0,0 +1,16 @@
+# Work around ini_file create option in 2.2 which defaults to no
+- name: Create cloud config file
+ file:
+ dest: "{{ openshift.common.config_base }}/cloudprovider/gce.conf"
+ state: touch
+ mode: 0660
+ owner: root
+ group: root
+ changed_when: false
+
+- name: Configure GCE cloud provider
+ ini_file:
+ dest: "{{ openshift.common.config_base }}/cloudprovider/gce.conf"
+ section: Global
+ option: multizone
+ value: "true"
diff --git a/roles/openshift_cloud_provider/tasks/main.yml b/roles/openshift_cloud_provider/tasks/main.yml
index e217e37ea..ab3055c8b 100644
--- a/roles/openshift_cloud_provider/tasks/main.yml
+++ b/roles/openshift_cloud_provider/tasks/main.yml
@@ -16,3 +16,6 @@
- include: aws.yml
when: cloudprovider_is_aws | bool
+
+- include: gce.yml
+ when: cloudprovider_is_gce | bool
diff --git a/roles/openshift_cloud_provider/vars/main.yml b/roles/openshift_cloud_provider/vars/main.yml
index 83bf6edc8..c9d953f58 100644
--- a/roles/openshift_cloud_provider/vars/main.yml
+++ b/roles/openshift_cloud_provider/vars/main.yml
@@ -2,3 +2,4 @@
has_cloudprovider: "{{ openshift_cloudprovider_kind | default(None) != None }}"
cloudprovider_is_aws: "{{ has_cloudprovider | bool and openshift_cloudprovider_kind == 'aws' }}"
cloudprovider_is_openstack: "{{ has_cloudprovider | bool and openshift_cloudprovider_kind == 'openstack' }}"
+cloudprovider_is_gce: "{{ has_cloudprovider | bool and openshift_cloudprovider_kind == 'gce' }}"
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index 6c045e7ab..95325610d 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -1060,6 +1060,7 @@ values provided as a list. Hence the gratuitous use of ['foo'] below.
kubelet_args['cloud-config'] = [cloud_cfg_path + '/openstack.conf']
if facts['cloudprovider']['kind'] == 'gce':
kubelet_args['cloud-provider'] = ['gce']
+ kubelet_args['cloud-config'] = [cloud_cfg_path + '/gce.conf']
# Automatically add node-labels to the kubeletArguments
# parameter. See BZ1359848 for additional details.
@@ -1102,6 +1103,7 @@ def build_controller_args(facts):
controller_args['cloud-config'] = [cloud_cfg_path + '/openstack.conf']
if facts['cloudprovider']['kind'] == 'gce':
controller_args['cloud-provider'] = ['gce']
+ kubelet_args['cloud-config'] = [cloud_cfg_path + '/gce.conf']
if controller_args != {}:
facts = merge_facts({'master': {'controller_args': controller_args}}, facts, [], [])
return facts
@@ -1122,6 +1124,7 @@ def build_api_server_args(facts):
api_server_args['cloud-config'] = [cloud_cfg_path + '/openstack.conf']
if facts['cloudprovider']['kind'] == 'gce':
api_server_args['cloud-provider'] = ['gce']
+ kubelet_args['cloud-config'] = [cloud_cfg_path + '/gce.conf']
if api_server_args != {}:
facts = merge_facts({'master': {'api_server_args': api_server_args}}, facts, [], [])
return facts