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>
This commit is contained in:
Gabriel Filion 2010-10-25 12:36:59 -04:00
parent aaf3bd6adb
commit 92aa5a51e9
2 changed files with 6 additions and 2 deletions

View file

@ -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

View file

@ -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;
}