summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/reboot_required_notify.pp15
-rw-r--r--manifests/reboot_required_notify/jessie.pp13
2 files changed, 27 insertions, 1 deletions
diff --git a/manifests/reboot_required_notify.pp b/manifests/reboot_required_notify.pp
index d0006f3..82466d2 100644
--- a/manifests/reboot_required_notify.pp
+++ b/manifests/reboot_required_notify.pp
@@ -1,5 +1,18 @@
class apt::reboot_required_notify {
- class { 'apt::reboot_required_notify::wheezy': }
+ $jessie_or_newer = $::operatingsystemmajrelease ? {
+ 5 => false,
+ 6 => false,
+ 7 => false,
+ default => true,
+ }
+
+ if $jessie_or_newer {
+ 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': }
+ }
}
diff --git a/manifests/reboot_required_notify/jessie.pp b/manifests/reboot_required_notify/jessie.pp
new file mode 100644
index 0000000..51b75a2
--- /dev/null
+++ b/manifests/reboot_required_notify/jessie.pp
@@ -0,0 +1,13 @@
+class apt::reboot_required_notify::jessie ($ensure = present) {
+
+ # On Jessie and newer, 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.
+ # This package also sends a daily email to the administrator when a system
+ # reboot is required, e.g. due to a kernel update.
+ package { 'reboot-notifier':
+ ensure => $ensure,
+ }
+
+}