restart_hosts.yml 706 B

1234567891011121314151617181920212223242526
  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. local_action:
  11. module: wait_for
  12. host="{{ ansible_host }}"
  13. state=started
  14. delay=10
  15. timeout=600
  16. become: no
  17. # Now that ssh is back up we can wait for API on the remote system,
  18. # avoiding some potential connection issues from local system:
  19. - name: Wait for master API to come back online
  20. wait_for:
  21. host: "{{ openshift.common.hostname }}"
  22. state: started
  23. delay: 10
  24. port: "{{ openshift.master.api_port }}"