From 3dc9ec415b24b57e721a6cf8392511da98b011ee Mon Sep 17 00:00:00 2001 From: nadir Date: Wed, 24 Feb 2010 13:55:06 +0100 Subject: Moved apt-get update and -autoclean to a seperate, optional cronjob in order to fasten the puppetrun and to decrease the I/O of embedded devices --- README | 4 ++++ manifests/init.pp | 17 ++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README b/README index 9968c03..5f990f5 100644 --- a/README +++ b/README @@ -102,6 +102,10 @@ Unfortunately there seems to be a bug in unattended-upgrades <= 0.25.1 that wildcards aren't recognized, so use it with care ! http://packages.debian.org/de/lenny/unattended-upgrades +apt::cron +--------- +Deploys a cronjob to run apt-get update && apt-get autoclean every hour + Resources ========= diff --git a/manifests/init.pp b/manifests/init.pp index 9a59e0c..2d05722 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -106,13 +106,8 @@ class apt { subscribe => [ File["/etc/apt/sources.list"], File["/etc/apt/preferences"], File["/etc/apt/apt.conf.d"], File[apt_config] ]; - "/usr/bin/apt-get update && /usr/bin/apt-get autoclean #hourly": - require => [ File["/etc/apt/sources.list"], - File["/etc/apt/preferences"], File[apt_config] ], - # Another Semaphor for all packages to reference - alias => apt_updated; } - + ## This package should really always be current package { "debian-archive-keyring": ensure => latest, @@ -270,9 +265,17 @@ class dselect { } -class apt::unattended_upgrades { +class apt::unattended_upgrades inherits apt { package { unattended-upgrades : ensure => latest; } file { "/etc/apt/apt.conf.d/50unattended-upgrades": source => "puppet://$server/modules/apt/50unattended-upgrades" } } +class apt::cron inherits apt { + file {'/etc/cron.d/apt.cron': + source => undef, + content => "# by puppet\n3 * * * * root /usr/bin/apt-get update && /usr/bin/apt-get autoclean\n", + notify => service["crond"]; + } +} + -- cgit v1.2.3