# Is there a reboot module or role for RHEL 7, like win\_reboot?

**URL:** <https://forum.ansible.com/t/is-there-a-reboot-module-or-role-for-rhel-7-like-win-reboot/23971>\
**Category:** Ansible Project\
**Tags:** rhel\
**Created:** [March 14, 2017, 6:37pm UTC](https://forum.ansible.com/t/is-there-a-reboot-module-or-role-for-rhel-7-like-win-reboot/23971 "2017-03-14T18:37:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Don\_Hunt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/don_hunt/32/9424_2.png) [@Don\_Hunt](https://forum.ansible.com/u/Don_Hunt)\
**Post date:** [March 14, 2017, 6:37pm UTC](https://forum.ansible.com/t/is-there-a-reboot-module-or-role-for-rhel-7-like-win-reboot/23971/1 "2017-03-14T18:37:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [March 15, 2017, 4:06pm UTC](https://forum.ansible.com/t/is-there-a-reboot-module-or-role-for-rhel-7-like-win-reboot/23971/2 "2017-03-15T16:06:42Z")

</div>

A reboot module only exist for Windows

But this should work pretty well

- name: Reboot  
&nbsp;&nbsp;&nbsp;shell: sleep 2 && shutdown -r  
&nbsp;&nbsp;&nbsp;async: 1  
&nbsp;&nbsp;&nbsp;poll: 0  
&nbsp;&nbsp;&nbsp;ignore\_errors: true

- name: Waiting for server to come back  
&nbsp;&nbsp;&nbsp;wait\_for:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;host: "{{ inventory\_hostname }}"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;port: 22  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;state: started  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delay: 30  
&nbsp;&nbsp;&nbsp;delegate\_to: localhost
