Use /var/run/reboot-required to determine if a restart is needed

The current check only looks to see if a new kernel was installed.
This commit is contained in:
Kevin Cernekee 2016-11-06 09:42:58 -08:00
parent fe0bbd7c76
commit a805dc0bef

View file

@ -12,7 +12,7 @@
- name: Check if reboot is required
shell: >
if [[ $(readlink -f /vmlinuz) != /boot/vmlinuz-$(uname -r) ]]; then echo "required"; else echo "no"; fi
if [[ -e /var/run/reboot-required ]]; then echo "required"; else echo "no"; fi
args:
executable: /bin/bash
register: reboot_required