main.yml 1.2 KB

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