|
@@ -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 }}"
|