Is there a reboot module or role for RHEL 7, like win_reboot?

30 views
Skip to first unread message

Don Hunt

unread,
Mar 15, 2017, 9:50:31 AM3/15/17
to Ansible Project
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.

Thanks,
Don

Kai Stian Olstad

unread,
Mar 15, 2017, 12:06:58 PM3/15/17
to ansible...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages