summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Filion <lelutin@gmail.com>2010-10-25 12:36:59 -0400
committerGabriel Filion <lelutin@gmail.com>2010-10-25 14:15:52 -0400
commit92aa5a51e95d74604a40318558aa98f70fcf7720 (patch)
tree00ad85b628531ce95a47c9b7be9be83fbf4eed26
parentaaf3bd6adb6cf979ce7c18492c3a60fa2b31cba9 (diff)
Ensure presence of sources.list.d and watch it
Add a file resource on the apt/sources.list.d directory to ensure that it is created as a directory and watch it for modifications to automatically refresh the apt cache. Signed-off-by: Gabriel Filion <lelutin@gmail.com>
-rw-r--r--manifests/init.pp7
-rw-r--r--manifests/sources_list.pp1
2 files changed, 6 insertions, 2 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 9298d1a..140d2a6 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -54,8 +54,13 @@ class apt {
}
}
- # watch apt.conf.d
+ # watch .d directories and ensure they are present
file { "/etc/apt/apt.conf.d": ensure => directory, checksum => mtime; }
+ file { "/etc/apt/sources.list.d":
+ ensure => directory,
+ checksum => mtime,
+ notify => Exec['refresh_apt'],
+ }
exec {
# "&& sleep 1" is workaround for older(?) clients
diff --git a/manifests/sources_list.pp b/manifests/sources_list.pp
index d3f18d5..bbf887a 100644
--- a/manifests/sources_list.pp
+++ b/manifests/sources_list.pp
@@ -12,7 +12,6 @@ define apt::sources_list (
file { "/etc/apt/sources.list.d/${name}":
ensure => $ensure,
- notify => Exec['refresh_apt'],
owner => root, group => 0, mode => 0600;
}