]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
Moved apt-get update and -autoclean to a seperate, optional cronjob in order to faste...
authornadir <nadir-technik@nadir.org>
Wed, 24 Feb 2010 12:55:06 +0000 (13:55 +0100)
committernadir <nadir-technik@nadir.org>
Wed, 24 Feb 2010 12:55:06 +0000 (13:55 +0100)
README
manifests/init.pp

diff --git a/README b/README
index 9968c03b75ff96c2e7db7ae4914e68b2b300ae29..5f990f5e483471f82fd166a15da42a114c930da1 100644 (file)
--- 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
 =========
index 9a59e0cba7146b06b7444736f185b8363081875c..2d05722af935f5f80c4cb5db815a5bbd5515b407 100644 (file)
@@ -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"]; 
+       }       
+}
+