module-apt/manifests/reboot_required_notify/jessie.pp
intrigeri 89a024678e 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!
2016-06-29 17:54:16 +00:00

28 lines
958 B
Puppet

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,
}
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
# 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,
require => Apt::Preferences_snippet['reboot-notifier'],
}
}