main.yml 1.3 KB

1234567891011121314151617181920212223242526
  1. ---
  2. - name: restart master
  3. service: name={{ openshift.common.service_type }}-master state=restarted
  4. when: (openshift.master.ha is not defined or not openshift.master.ha | bool) and (not (master_service_status_changed | default(false) | bool))
  5. notify: Verify API Server
  6. - name: restart master api
  7. service: name={{ openshift.common.service_type }}-master-api state=restarted
  8. when: (openshift.master.ha is defined and openshift.master.ha | bool) and (not (master_api_service_status_changed | default(false) | bool)) and openshift.master.cluster_method == 'native'
  9. notify: Verify API Server
  10. - name: restart master controllers
  11. service: name={{ openshift.common.service_type }}-master-controllers state=restarted
  12. when: (openshift.master.ha is defined and openshift.master.ha | bool) and (not (master_controllers_service_status_changed | default(false) | bool)) and openshift.master.cluster_method == 'native'
  13. - name: Verify API Server
  14. # Using curl here since the uri module requires python-httplib2 and
  15. # wait_for port doesn't provide health information.
  16. command: >
  17. curl --silent --cacert {{ openshift.common.config_base }}/master/ca.crt
  18. {{ openshift.master.api_url }}/healthz/ready
  19. register: api_available_output
  20. until: api_available_output.stdout == 'ok'
  21. retries: 120
  22. delay: 1
  23. changed_when: false