Browse Source

Disable master controllers before upgrade and re-enable those when restart mode is system

This removes a start/stop after control plane upgrade
Vadim Rutkovsky 7 years ago
parent
commit
0fad99cb1c

+ 6 - 0
playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml

@@ -96,6 +96,12 @@
   - include_tasks: "{{ openshift_master_upgrade_hook }}"
     when: openshift_master_upgrade_hook is defined
 
+  - name: Disable master controller
+    service:
+      name: "{{ openshift_service_type }}-master-controllers"
+      enabled: false
+    when: openshift.common.rolling_restart_mode == 'system'
+
   - include_tasks: ../../../openshift-master/private/tasks/restart_hosts.yml
     when: openshift.common.rolling_restart_mode == 'system'
 

+ 8 - 6
playbooks/common/openshift-cluster/upgrades/v3_9/upgrade_control_plane.yml

@@ -123,14 +123,16 @@
   roles:
   - role: openshift_facts
   tasks:
-  - name: Stop {{ openshift_service_type }}-master-controllers
-    systemd:
+  - name: Restart master controllers to force new leader election mode
+    service:
       name: "{{ openshift_service_type }}-master-controllers"
-      state: stopped
-  - name: Start {{ openshift_service_type }}-master-controllers
-    systemd:
+      state: restart
+    when: openshift.common.rolling_restart_mode == 'service'
+  - name: Re-enable master controllers to force new leader election mode
+    service:
       name: "{{ openshift_service_type }}-master-controllers"
-      state: started
+      enabled: true
+    when: openshift.common.rolling_restart_mode == 'system'
 
 - import_playbook: ../post_control_plane.yml