verify_control_plane_running.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. ---
  2. - name: Verify master processes
  3. hosts: oo_masters_to_config
  4. roles:
  5. - openshift_facts
  6. tasks:
  7. - openshift_facts:
  8. role: master
  9. local_facts:
  10. ha: "{{ groups.oo_masters_to_config | length > 1 }}"
  11. - when: openshift.common.is_containerized | bool
  12. block:
  13. - set_fact:
  14. master_services:
  15. - "{{ openshift_service_type }}-master"
  16. # In case of the non-ha to ha upgrade.
  17. - name: Check if the {{ openshift_service_type }}-master-api.service exists
  18. command: >
  19. systemctl list-units {{ openshift_service_type }}-master-api.service --no-legend
  20. register: master_api_service_status
  21. - set_fact:
  22. master_services:
  23. - "{{ openshift_service_type }}-master-api"
  24. - "{{ openshift_service_type }}-master-controllers"
  25. when:
  26. - master_api_service_status.stdout_lines | length > 0
  27. - (openshift_service_type + '-master-api.service') in master_api_service_status.stdout_lines[0]
  28. - name: Ensure Master is running
  29. service:
  30. name: "{{ item }}"
  31. state: started
  32. enabled: yes
  33. with_items: "{{ master_services }}"