From 3630285006d9fb60c5fbecebc976623c37dd1395 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 31 Aug 2015 20:01:22 +0000 Subject: reboot_required_notify: add initial support for Jessie and newer. Note that reboot-notifier is only in stretch/sid at the moment, so to use this one needs to configure APT pinning themselves to make this package installable. --- manifests/reboot_required_notify/jessie.pp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 manifests/reboot_required_notify/jessie.pp (limited to 'manifests/reboot_required_notify/jessie.pp') 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, + } + +} -- cgit v1.2.3 From e70a6712d31e91ecbf71f4de841735c3b36193ba Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 16 Mar 2016 14:26:52 +0000 Subject: apt::reboot_required_notify::jessie: manage APT pinning to fetch reboot-notifier from jessie-backports, when running on Jessie. --- manifests/reboot_required_notify/jessie.pp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'manifests/reboot_required_notify/jessie.pp') diff --git a/manifests/reboot_required_notify/jessie.pp b/manifests/reboot_required_notify/jessie.pp index 51b75a2..9b5a0c0 100644 --- a/manifests/reboot_required_notify/jessie.pp +++ b/manifests/reboot_required_notify/jessie.pp @@ -1,5 +1,15 @@ class apt::reboot_required_notify::jessie ($ensure = present) { + $pinning_ensure = $::operatingsystemmajrelease ? { + 8 => present, + default => absent, + } + apt::preferences_snippet { 'reboot-notifier': + ensure => $pinning_ensure, + pin => 'release o=Debian Backports,a=jessie-backports', + priority => 991, + } + # 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 @@ -7,7 +17,8 @@ class apt::reboot_required_notify::jessie ($ensure = present) { # 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, + ensure => $ensure, + require => Apt::Preferences_snippet['reboot-notifier'], } - + } -- cgit v1.2.3 From 89a024678e39fec8a5c05371bcceaece605fbd88 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 29 Jun 2016 17:54:16 +0000 Subject: apt::reboot_required_notify::jessie: explicitly check that $apt::use_backports is true when running Jessie. Otherwise, it would fail anyway when trying to install reboot-notifier, but in a way less user-friendly. Thanks to lavamind for the suggestion! --- manifests/reboot_required_notify/jessie.pp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'manifests/reboot_required_notify/jessie.pp') diff --git a/manifests/reboot_required_notify/jessie.pp b/manifests/reboot_required_notify/jessie.pp index 9b5a0c0..2de6b62 100644 --- a/manifests/reboot_required_notify/jessie.pp +++ b/manifests/reboot_required_notify/jessie.pp @@ -1,5 +1,9 @@ class apt::reboot_required_notify::jessie ($ensure = present) { + if $::operatingsystemmajrelease == 8 and ! $::apt::use_backports { + fail('apt::reboot_required_notify requires $apt::use_backports on Jessie') + } + $pinning_ensure = $::operatingsystemmajrelease ? { 8 => present, default => absent, -- cgit v1.2.3