Browse Source

Merge pull request #8530 from dav1x/fix_vsphere_master

fixes issue 8528 - adding master configuration into cloud provider role
OpenShift Merge Robot 6 years ago
parent
commit
2722c903d5

+ 1 - 1
playbooks/openshift-master/private/upgrade.yml

@@ -107,7 +107,7 @@
 
   - name: update vsphere provider master config
     import_role:
-      name: openshift_control_plane
+      name: openshift_cloud_provider
       tasks_from: update-vsphere
     when:
     - openshift_cloudprovider_kind is defined

+ 27 - 0
roles/openshift_cloud_provider/handlers/main.yml

@@ -0,0 +1,27 @@
+---
+- name: restart master
+  command: /usr/local/bin/master-restart "{{ item }}"
+  with_items:
+  - api
+  - controllers
+  when:
+  - not (master_api_service_status_changed | default(false) | bool)
+  notify:
+  - verify API server
+
+- name: verify API server
+  # Using curl here since the uri module requires python-httplib2 and
+  # wait_for port doesn't provide health information.
+  command: >
+    curl --silent --tlsv1.2 --max-time 2
+    --cacert {{ openshift.common.config_base }}/master/ca-bundle.crt
+    {{ openshift.master.api_url }}/healthz/ready
+  args:
+    # Disables the following warning:
+    # Consider using get_url or uri module rather than running curl
+    warn: no
+  register: l_api_available_output
+  until: l_api_available_output.stdout == 'ok'
+  retries: 120
+  delay: 1
+  changed_when: false

roles/openshift_control_plane/tasks/update-vsphere.yml → roles/openshift_cloud_provider/tasks/update-vsphere.yml


+ 16 - 1
roles/openshift_cloud_provider/tasks/vsphere.yml

@@ -3,4 +3,19 @@
   template:
     dest: "{{ openshift.common.config_base }}/cloudprovider/vsphere.conf"
     src: vsphere.conf.j2
-  when: openshift_cloudprovider_vsphere_username is defined and openshift_cloudprovider_vsphere_password is defined and openshift_cloudprovider_vsphere_host is defined and openshift_cloudprovider_vsphere_datacenter is defined and openshift_cloudprovider_vsphere_datastore is defined
+  when:
+  - openshift_cloudprovider_vsphere_username is defined
+  - openshift_cloudprovider_vsphere_password is defined
+  - openshift_cloudprovider_vsphere_host is defined
+  - openshift_cloudprovider_vsphere_datacenter is defined
+  - openshift_cloudprovider_vsphere_datastore is defined
+
+- name: Configure vsphere svc account
+  import_tasks: vsphere-svc.yml
+  when:
+  - openshift_version | version_compare('3.9', '>=')
+  - inventory_hostname == openshift_master_hosts[0]
+
+- name: Modify controller args
+  import_tasks: update-vsphere.yml
+  notify: restart master