Add cron-apt support.

This commit is contained in:
intrigeri 2010-10-06 14:06:50 +02:00
parent fab154da39
commit 208e60b864
4 changed files with 60 additions and 2 deletions

17
README
View file

@ -110,9 +110,22 @@ the Debian official backports and the Debian Volatile archive.
Classes
=======
This module contains only the apt class, which sets up all described
functionality.
apt
---
The apt class sets up all documented functionality but cron-apt.
apt::cron::download
-------------------
This class sets up cron-apt so that it downloads upgradable packages,
does not actually do any upgrade and email when the output changes.
apt::cron::dist-upgrade
-----------------------
This class sets up cron-apt so that it dist-upgrades the system and
email when upgrades are performed.
Resources
=========

3
manifests/cron/base.pp Normal file
View file

@ -0,0 +1,3 @@
class apt::cron::base {
package { cron-apt: ensure => installed }
}

View file

@ -0,0 +1,21 @@
class apt::cron::dist-upgrade inherits cron-apt::base {
$action = "autoclean -y
dist-upgrade -y -o APT::Get::Show-Upgraded=true
"
file { "/etc/cron-apt/action.d/3-download":
ensure => absent,
}
config_file { "/etc/cron-apt/action.d/4-dist-upgrade":
content => $action,
require => Package[cron-apt]
}
config_file { "/etc/cron-apt/config.d/MAILON":
content => "MAILON=upgrade\n",
require => Package[cron-apt]
}
}

View file

@ -0,0 +1,21 @@
class apt::cron::download inherits cron-apt::base {
$action = "autoclean -y
dist-upgrade -d -y -o APT::Get::Show-Upgraded=true
"
file { "/etc/cron-apt/action.d/4-dist-upgrade":
ensure => absent,
}
config_file { "/etc/cron-apt/action.d/3-download":
content => $action,
require => Package[cron-apt]
}
config_file { "/etc/cron-apt/config.d/MAILON":
content => "MAILON=changes\n",
require => Package[cron-apt]
}
}