summaryrefslogtreecommitdiff
path: root/manifests/reboot_required_notify/wheezy.pp
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2016-11-04 14:39:23 +0100
committervarac <varacanero@zeromail.org>2016-11-04 14:39:23 +0100
commit5d001efb65f4ac2afa39d17b7b62d4f861f450a3 (patch)
tree88b282297150f4890fce19182206dc9bfa0f3a9d /manifests/reboot_required_notify/wheezy.pp
parent33c61e8df59db1abbed379a9e9790946060a8f1e (diff)
parent584b7aad338206026d62d846122e6bef532a2d2a (diff)
Merge remote-tracking branch 'shared/master' into leap_master
Diffstat (limited to 'manifests/reboot_required_notify/wheezy.pp')
-rw-r--r--manifests/reboot_required_notify/wheezy.pp23
1 files changed, 23 insertions, 0 deletions
diff --git a/manifests/reboot_required_notify/wheezy.pp b/manifests/reboot_required_notify/wheezy.pp
new file mode 100644
index 0000000..06998ef
--- /dev/null
+++ b/manifests/reboot_required_notify/wheezy.pp
@@ -0,0 +1,23 @@
+class apt::reboot_required_notify::wheezy ($ensure = present) {
+
+ # On Wheezy and older, 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 => $ensure,
+ }
+
+ # 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':
+ ensure => $ensure,
+ 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'],
+ }
+
+}