Check for reboot

24 views
Skip to first unread message

MJP

unread,
Jun 29, 2016, 4:42:30 PM6/29/16
to Ansible Project
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

Kai Stian Olstad

unread,
Jun 30, 2016, 2:46:13 AM6/30/16
to ansible...@googlegroups.com
On 29.06.2016 16:53, MJP wrote:
> 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.

Have you checked the examples in the documentation for the stat module
https://docs.ansible.com/ansible/stat_module.html#examples

Maybe that solves your need.

--
Kai Stian Olstad

MJP

unread,
Jun 30, 2016, 8:34:37 AM6/30/16
to Ansible Project, ansible-pr...@olstad.com
Thanks.  I found this link that is similar:


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

Ariel Gerardo Ríos

unread,
Jun 30, 2016, 5:49:18 PM6/30/16
to ansible...@googlegroups.com, ansible-pr...@olstad.com
Hello Marvin. Maybe you can make use of debug module: 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.

--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/0ca6220a-c0f8-4593-aa0e-a19826bea525%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Ariel Gerardo Ríos
Reply all
Reply to author
Forward
0 new messages