diff options
author | Micah <micah@leap.se> | 2016-05-24 10:19:22 -0400 |
---|---|---|
committer | Micah <micah@leap.se> | 2016-05-24 10:19:22 -0400 |
commit | aba291e2de1682620b6dc22446b30fe870b62956 (patch) | |
tree | 1ba5e08c285dbf2b60e7be2f59934e6abd5f866c /manifests/reboot_required_notify.pp |
Squashed 'puppet/modules/apt/' content from commit 33c61e8
git-subtree-dir: puppet/modules/apt
git-subtree-split: 33c61e8df59db1abbed379a9e9790946060a8f1e
Diffstat (limited to 'manifests/reboot_required_notify.pp')
-rw-r--r-- | manifests/reboot_required_notify.pp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/manifests/reboot_required_notify.pp b/manifests/reboot_required_notify.pp new file mode 100644 index 00000000..722e8a5e --- /dev/null +++ b/manifests/reboot_required_notify.pp @@ -0,0 +1,21 @@ +class apt::reboot_required_notify { + + # This package installs the script that created /var/run/reboot-required*. + # This script (/usr/share/update-notifier/notify-reboot-required) is + # triggered e.g. by kernel packages. + package { 'update-notifier-common': + ensure => installed, + } + + # cron-apt defaults to run every night at 4 o'clock + # plus some random time <1h. + # so we check if a reboot is required a bit later. + cron { 'apt_reboot_required_notify': + command => 'if [ -f /var/run/reboot-required ]; then echo "Reboot required\n" ; cat /var/run/reboot-required.pkgs ; fi', + user => root, + hour => 5, + minute => 20, + require => Package['update-notifier-common'], + } + +} |