# Check for reboot

**URL:** <https://forum.ansible.com/t/check-for-reboot/21889>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [June 29, 2016, 2:53pm UTC](https://forum.ansible.com/t/check-for-reboot/21889 "2016-06-29T14:53:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MJP](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@MJP](https://forum.ansible.com/u/MJP)\
**Post date:** [June 29, 2016, 2:53pm UTC](https://forum.ansible.com/t/check-for-reboot/21889/1 "2016-06-29T14:53:41Z")

</div>

Hello,

We are currently using Ansible to install security updates to our Ubuntu 14.04 servers. We are using apticron to tell us when updates are available and we are using unattended-upgrades to install the updates. We want to manually reboot the server not when it installs the updates.

We would like to run an ansible playbook to output what servers are in need of a reboot. I now you can check to see if /var/run/reboot-required is listed, but i’m not sure how to output it.

Any help would be appreciated.

Thanks

---

<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:** [June 30, 2016, 6:46am UTC](https://forum.ansible.com/t/check-for-reboot/21889/2 "2016-06-30T06:46:01Z")

</div>

Have you checked the examples in the documentation for the stat module  
[https://docs.ansible.com/ansible/stat\_module.html#examples](https://docs.ansible.com/ansible/stat_module.html#examples)

Maybe that solves your need.

---

<div class="post-metadata">

**Author:** ![MJP](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@MJP](https://forum.ansible.com/u/MJP)\
**Post date:** [June 30, 2016, 12:34pm UTC](https://forum.ansible.com/t/check-for-reboot/21889/3 "2016-06-30T12:34:37Z")

</div>

Thanks. I found this link that is similar:

[https://realguess.net/2014/12/21/ansible-update-servers-to-the-latest-and-reboot/](https://realguess.net/2014/12/21/ansible-update-servers-to-the-latest-and-reboot/)

But that only reboots it if exists, i just need it to say yes or no that it exists.

---

<div class="post-metadata">

**Author:** ![Ariel\_Gerardo\_Rios](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@Ariel\_Gerardo\_Rios](https://forum.ansible.com/u/Ariel_Gerardo_Rios)\
**Post date:** [June 30, 2016, 9:47pm UTC](https://forum.ansible.com/t/check-for-reboot/21889/4 "2016-06-30T21:47:19Z")

</div>

Hello Marvin. Maybe you can make use of debug module: [http://docs.ansible.com/ansible/debug\_module.html](http://docs.ansible.com/ansible/debug_module.html). You could print out a message for the user to know when conditions are met for reboot.

Best regards.
