Currently i’m running a playbook against multiple servers, is there a way to print something if a server needs a reboot after an apt-get upgrade?
i mean if the kernel gets upgraded i need to know which of them needs an restart.
is there a possible way that ansible could report such thing
Perhaps not the “Ansible way”, but you could install ‘update-notifer-common’ package and see if /var/run/reboot-required file is present - perhaps via nagios or cron + mail message.
http://serverfault.com/questions/92932/how-does-ubuntu-keep-track-of-the-system-restart-required-flag-in-motd
https://packages.debian.org/wheezy/update-notifier-common
Maciej
That seems pretty darn reasonable to me.
The ansible stat module could be used to check for presense of that file at the end of the run, and reboot (and wait for SSH to come back up) if so desired.
And what about yum based systems? I already made a working playbook with the apt upgrade and its really awesome. Finally a solution to drop out puppet (: