aboutsummaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-01-02 11:11:35 -0200
committerSilvio Rhatto <rhatto@riseup.net>2010-01-02 11:11:35 -0200
commit8a02e814ee8dd1fa608bcde0942dae6e9663437b (patch)
tree11dc41e6a87a14c1298b6707687a859e0405c530 /manifests/init.pp
parent9c7862d255ab9082328f4e9d9d4089ba92a8b915 (diff)
downloadpuppet-apt-8a02e814ee8dd1fa608bcde0942dae6e9663437b.tar.gz
puppet-apt-8a02e814ee8dd1fa608bcde0942dae6e9663437b.tar.bz2
Introducing $apt_update_method
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp31
1 files changed, 24 insertions, 7 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 9ef9768..a791a37 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -16,6 +16,11 @@ class apt {
default => $backports_enabled,
}
+ $apt_update_method = $apt_update_method {
+ '' => 'exec',
+ default => $apt_update_method,
+ }
+
package { apt: ensure => installed }
# a few templates need lsbdistcodename
@@ -83,13 +88,25 @@ class apt {
refreshonly => true,
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;
- }
+ File[apt_config] ],
+ }
+
+ if $apt_update_method == 'exec' {
+ exec { "/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,
+ }
+ } else {
+ cron { "apt_updated":
+ command => "/usr/bin/apt-get update && /usr/bin/apt-get autoclean #hourly &> /dev/null",
+ user => root,
+ hour => "*/1",
+ minute => "0",
+ ensure => present,
+ require => [ File["/etc/apt/sources.list"], File["/etc/apt/preferences"], File[apt_config] ],
+ }
+ }
## This package should really always be current
package { "debian-archive-keyring":