From aba291e2de1682620b6dc22446b30fe870b62956 Mon Sep 17 00:00:00 2001 From: Micah Date: Tue, 24 May 2016 10:19:22 -0400 Subject: Squashed 'puppet/modules/apt/' content from commit 33c61e8 git-subtree-dir: puppet/modules/apt git-subtree-split: 33c61e8df59db1abbed379a9e9790946060a8f1e --- manifests/reboot_required_notify.pp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 manifests/reboot_required_notify.pp (limited to 'manifests/reboot_required_notify.pp') 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'], + } + +} -- cgit v1.2.3