main.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  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. # We retry the controllers because the API may not be 100% initialized yet.
  7. - name: restart master controllers
  8. command: "{{ openshift.common.service_type }}-master-controllers"
  9. retries: 3
  10. delay: 5
  11. register: result
  12. until: result.rc == 0
  13. when: (not (master_controllers_service_status_changed | default(false) | bool)) and openshift.master.cluster_method == 'native'
  14. - name: Verify API Server
  15. # Using curl here since the uri module requires python-httplib2 and
  16. # wait_for port doesn't provide health information.
  17. command: >
  18. curl --silent --tlsv1.2
  19. {% if openshift.common.version_gte_3_2_or_1_2 | bool %}
  20. --cacert {{ openshift.common.config_base }}/master/ca-bundle.crt
  21. {% else %}
  22. --cacert {{ openshift.common.config_base }}/master/ca.crt
  23. {% endif %}
  24. {{ openshift.master.api_url }}/healthz/ready
  25. args:
  26. # Disables the following warning:
  27. # Consider using get_url or uri module rather than running curl
  28. warn: no
  29. register: api_available_output
  30. until: api_available_output.stdout == 'ok'
  31. retries: 120
  32. delay: 1
  33. changed_when: false