reboot_required_notify::wheezy: add an "ensure" parameter, defaulting to "present".

This commit is contained in:
intrigeri 2015-08-31 19:56:16 +00:00
parent e2ea89aa7a
commit a82e3ae272

View file

@ -1,17 +1,18 @@
class apt::reboot_required_notify::wheezy {
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 => installed,
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,