main.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. ---
  2. - name: restart master api
  3. systemd:
  4. name: "{{ openshift.common.service_type }}-master-api"
  5. state: restarted
  6. when:
  7. - not (master_api_service_status_changed | default(false) | bool)
  8. - openshift.master.cluster_method == 'native'
  9. notify:
  10. - Verify API Server
  11. - name: restart master controllers
  12. systemd:
  13. name: "{{ openshift.common.service_type }}-master-controllers"
  14. state: restarted
  15. when:
  16. - not (master_controllers_service_status_changed | default(false) | bool)
  17. - openshift.master.cluster_method == 'native'
  18. - name: Verify API Server
  19. # Using curl here since the uri module requires python-httplib2 and
  20. # wait_for port doesn't provide health information.
  21. command: >
  22. curl --silent --tlsv1.2
  23. {% if openshift.common.version_gte_3_2_or_1_2 | bool %}
  24. --cacert {{ openshift.common.config_base }}/master/ca-bundle.crt
  25. {% else %}
  26. --cacert {{ openshift.common.config_base }}/master/ca.crt
  27. {% endif %}
  28. {{ openshift.master.api_url }}/healthz/ready
  29. args:
  30. # Disables the following warning:
  31. # Consider using get_url or uri module rather than running curl
  32. warn: no
  33. register: l_api_available_output
  34. until: l_api_available_output.stdout == 'ok'
  35. retries: 120
  36. delay: 1
  37. changed_when: false