summaryrefslogtreecommitdiff
path: root/manifests/reboot_required_notify.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/reboot_required_notify.pp')
-rw-r--r--manifests/reboot_required_notify.pp22
1 files changed, 6 insertions, 16 deletions
diff --git a/manifests/reboot_required_notify.pp b/manifests/reboot_required_notify.pp
index 722e8a5..efd8aeb 100644
--- a/manifests/reboot_required_notify.pp
+++ b/manifests/reboot_required_notify.pp
@@ -1,21 +1,11 @@
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'],
+ if versioncmp($::operatingsystemmajrelease, 8) >= 0 {
+ class { 'apt::reboot_required_notify::jessie': }
+ # Clean up systems that were upgraded from Wheezy or earlier:
+ class { 'apt::reboot_required_notify::wheezy': ensure => absent }
+ } else {
+ class { 'apt::reboot_required_notify::wheezy': }
}
}