restart_hosts.yml 642 B

1234567891011121314151617181920212223
  1. ---
  2. - name: Restart master system
  3. # https://github.com/ansible/ansible/issues/10616
  4. shell: sleep 2 && shutdown -r now "OpenShift Ansible master rolling restart"
  5. async: 1
  6. poll: 0
  7. ignore_errors: true
  8. become: yes
  9. - name: Wait for master to restart
  10. wait_for_connection:
  11. delay: 10
  12. timeout: 600
  13. # Now that ssh is back up we can wait for API on the remote system,
  14. # avoiding some potential connection issues from local system:
  15. - name: Wait for master API to come back online
  16. wait_for:
  17. host: "{{ openshift.common.hostname }}"
  18. state: started
  19. delay: 10
  20. port: "{{ openshift_master_api_port }}"
  21. timeout: 600