default => $backports_enabled,
}
+ $apt_update_method = $apt_update_method {
+ '' => 'exec',
+ default => $apt_update_method,
+ }
+
package { apt: ensure => installed }
# a few templates need lsbdistcodename
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":