restart_hosts_pacemaker.yml 825 B

12345678910111213141516171819202122232425
  1. - name: Fail over master resource
  2. command: >
  3. pcs resource move master {{ hostvars | oo_select_keys(groups['oo_masters_to_config']) | oo_collect('openshift.common.hostname', {'is_active': 'False'}) | list | first }}
  4. - name: Wait for master API to come back online
  5. become: no
  6. local_action:
  7. module: wait_for
  8. host="{{ openshift.master.cluster_hostname }}"
  9. state=started
  10. delay=10
  11. port="{{ openshift.master.api_port }}"
  12. - name: Restart master system
  13. # https://github.com/ansible/ansible/issues/10616
  14. shell: sleep 2 && shutdown -r now "OpenShift Ansible master rolling restart"
  15. async: 1
  16. poll: 0
  17. ignore_errors: true
  18. become: yes
  19. - name: Wait for master to start
  20. become: no
  21. local_action:
  22. module: wait_for
  23. host="{{ inventory_hostname }}"
  24. state=started
  25. delay=10