aboutsummaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2016-01-26 14:42:17 +0100
committervarac <varacanero@zeromail.org>2016-02-01 20:25:46 +0100
commitf12b007edd557e91359fd9a5fba57f49e4a59a04 (patch)
tree1d7e9fbab069b5124f4ab194824a626b2243474c /manifests/init.pp
parentfa1751c4de0154de7431ea18f57ddaeff329cf73 (diff)
downloadpuppet-apt-f12b007edd557e91359fd9a5fba57f49e4a59a04.tar.gz
puppet-apt-f12b007edd557e91359fd9a5fba57f49e4a59a04.tar.bz2
[refactor] Unify `apt-get update` into one resource
Before, there were two Execs that did an `apt-get update`, `Exec[refresh_apt]` and `Exec[apt_updated]`, which were triggered by different resources. This changes gets rid of the first one, and all resources now depend on `Exec[apt_updated]`.
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp14
1 files changed, 13 insertions, 1 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 1e7ddd7..f9f9357 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -50,7 +50,7 @@ class apt(
# additional sources should be included via the apt::sources_list define
'/etc/apt/sources.list':
content => $sources_content,
- notify => Exec['refresh_apt'],
+ notify => Exec['apt_updated'],
owner => root,
group => 0,
mode => '0644';
@@ -137,4 +137,16 @@ class apt(
# workaround for preseeded_package component
file { [ '/var/cache', '/var/cache/local', '/var/cache/local/preseeding' ]: ensure => directory }
+
+ exec { 'update_apt':
+ command => '/usr/bin/apt-get update && /usr/bin/apt-get autoclean',
+ require => [
+ File['/etc/apt/apt.conf.d', '/etc/apt/preferences' ],
+ File['/etc/apt/sources.list'] ],
+ loglevel => 'info',
+ refreshonly => true,
+ # Another Semaphor for all packages to reference
+ alias => [ 'apt_updated', 'refresh_apt']
+ }
+
}