On 14. mars 2017 19:37, Don Hunt wrote:
I've been searching, without satisfaction, for an Ansible module or role to
handle a RHEL 7 reboot gracefully.

I'll begin playing with the command or shell modules to do this, but it
seems that it should already exist.

A reboot module only exist for Windows

But this should work pretty well

- name: Reboot
  shell: sleep 2 && shutdown -r
  async: 1
  poll: 0
  ignore_errors: true

- name: Waiting for server to come back
  wait_for:
    host: "{{ inventory_hostname }}"
    port: 22
    state: started
    delay: 30
  delegate_to: localhost


--
Kai Stian Olstad

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/713d6129-ff27-d707-9fbd-cb39ac61669f%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to