summaryrefslogtreecommitdiffstats
path: root/playbooks/common
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2017-10-23 16:06:03 -0400
committerGitHub <noreply@github.com>2017-10-23 16:06:03 -0400
commit211f4465aac819029beee118dfc0644c3c959a10 (patch)
tree83780f8e4f23f21bf051a2ee2ce0feb5743fda7f /playbooks/common
parentce79a0c1f47809a847a3b6cc0f32851bfb77d9c6 (diff)
parentd1fb8def27fdd90964bc0522c8d0a962ddb914fe (diff)
downloadopenshift-211f4465aac819029beee118dfc0644c3c959a10.tar.gz
openshift-211f4465aac819029beee118dfc0644c3c959a10.tar.bz2
openshift-211f4465aac819029beee118dfc0644c3c959a10.tar.xz
openshift-211f4465aac819029beee118dfc0644c3c959a10.zip
Merge pull request #5845 from ingvagabund/check-correct-master-services
Check if the master service is non-ha or not
Diffstat (limited to 'playbooks/common')
-rw-r--r--playbooks/common/openshift-cluster/upgrades/pre/verify_control_plane_running.yml37
1 files changed, 25 insertions, 12 deletions
diff --git a/playbooks/common/openshift-cluster/upgrades/pre/verify_control_plane_running.yml b/playbooks/common/openshift-cluster/upgrades/pre/verify_control_plane_running.yml
index 45022cd61..6a5bc24f7 100644
--- a/playbooks/common/openshift-cluster/upgrades/pre/verify_control_plane_running.yml
+++ b/playbooks/common/openshift-cluster/upgrades/pre/verify_control_plane_running.yml
@@ -9,16 +9,29 @@
local_facts:
ha: "{{ groups.oo_masters_to_config | length > 1 }}"
- - name: Ensure HA Master is running
- service:
- name: "{{ openshift.common.service_type }}-master-api"
- state: started
- enabled: yes
- when: openshift.common.is_containerized | bool
+ - when: openshift.common.is_containerized | bool
+ block:
+ - set_fact:
+ master_services:
+ - "{{ openshift.common.service_type }}-master"
- - name: Ensure HA Master is running
- service:
- name: "{{ openshift.common.service_type }}-master-controllers"
- state: started
- enabled: yes
- when: openshift.common.is_containerized | bool
+ # In case of the non-ha to ha upgrade.
+ - name: Check if the {{ openshift.common.service_type }}-master-api.service exists
+ command: >
+ systemctl list-units {{ openshift.common.service_type }}-master-api.service --no-legend
+ register: master_api_service_status
+
+ - set_fact:
+ master_services:
+ - "{{ openshift.common.service_type }}-master-api"
+ - "{{ openshift.common.service_type }}-master-controllers"
+ when:
+ - master_api_service_status.stdout_lines | length > 0
+ - (openshift.common.service_type + '-master-api.service') in master_api_service_status.stdout_lines[0]
+
+ - name: Ensure Master is running
+ service:
+ name: "{{ item }}"
+ state: started
+ enabled: yes
+ with_items: "{{ master_services }}"