diff options
author | mh <mh@immerda.ch> | 2009-10-30 20:35:30 +0100 |
---|---|---|
committer | mh <mh@immerda.ch> | 2009-10-30 20:35:30 +0100 |
commit | 84f7ca76419eecc83cb2bddb048b2e3fb6e36386 (patch) | |
tree | 71e21d8b294425137fdda834f116979cd7eee8f5 | |
parent | b0e0f720d0f0480c96c377bde6f46a2d8820f646 (diff) | |
download | puppet-apt-84f7ca76419eecc83cb2bddb048b2e3fb6e36386.tar.gz puppet-apt-84f7ca76419eecc83cb2bddb048b2e3fb6e36386.tar.bz2 |
introduce a class to manage unattended-upgrades
-rw-r--r-- | README | 8 | ||||
-rw-r--r-- | manifests/init.pp | 4 | ||||
-rw-r--r-- | manifests/unattended_upgrades.pp | 12 |
3 files changed, 23 insertions, 1 deletions
@@ -34,7 +34,6 @@ From apt.conf(5), 0.7.2: instance). pre-auto performs this action before downloading new packages." - $lsbdistcodename ---------------- Contains the codename ("etch", "lenny", ...) of the client's @@ -69,6 +68,13 @@ apt keyring, you can set this variable to a path in your fileserver where individual key files can be placed. If this is set and keys exist there, this module will apt-key add each key +$apt_unattended_upgrades +------------------------ + +If this variable is set to true apt::unattended_upgrades is included, +which will install the package unattended-upgrades and configure it to +daily upgrade the system. + Classes ======= diff --git a/manifests/init.pp b/manifests/init.pp index d6a8fb7..5dc0d75 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -41,6 +41,10 @@ class apt { } } + if $apt_unattended_upgrades { + include apt::unattended_upgrades + } + $apt_base_dir = "${module_dir_path}/apt" module_dir { apt: } # watch apt.conf.d diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp new file mode 100644 index 0000000..f4544fa --- /dev/null +++ b/manifests/unattended_upgrades.pp @@ -0,0 +1,12 @@ +class apt::unattended_upgrades { + package{'unattended-upgrades': } + config_file { + "/etc/apt/apt.conf.d/unattended_upgrades": + content => "APT::Periodic::Update-Package-Lists "1"; +APT::Periodic::Unattended-Upgrade "1"; +", + before => File[apt_config], + require => Package['unattended-upgrades'], + } + } +} |