]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
Force an apt-get update when changing an apt::sources_list
authorGabriel Filion <lelutin@gmail.com>
Mon, 9 Apr 2012 05:39:29 +0000 (01:39 -0400)
committerGabriel Filion <lelutin@gmail.com>
Mon, 9 Apr 2012 05:39:29 +0000 (01:39 -0400)
sources_list doesn't currently force puppet to run 'apt-get update'
after creating/modifying/removing files in sources.list.d.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
manifests/apt_conf.pp
manifests/init.pp
manifests/sources_list.pp

index 03ae1ac4508f7512d3ed01300870e42d6aade826..fe07546698732cb1e901ea1b467c7f2a0514f566 100644 (file)
@@ -14,10 +14,13 @@ define apt::apt_conf(
 
   include apt::dot_d_directories
 
+  # One would expect the 'file' resource on sources.list.d to trigger an
+  # apt-get update when files are added or modified in the directory, but it
+  # apparently doesn't.
   file { "/etc/apt/apt.conf.d/${name}":
     ensure => $ensure,
+    owner => root, group => 0, mode => 0644,
     notify => Exec["refresh_apt"],
-    owner => root, group => 0, mode => 0644;
   }
 
   if $source {
index 0d58c6154c744af7c2ed8f8dbb1a2e37ee390114..4d65e77c82bb2ca40a02eb35eb2ba9820f4be0fd 100644 (file)
@@ -85,7 +85,8 @@ class apt {
         '' => template( "apt/$operatingsystem/sources.list.erb"),
         default => $custom_sources_list
       },
-      require => Package['lsb'];
+      require => Package['lsb'],
+      notify => Exec['refresh_apt'],
   }
 
   apt_conf { "02show_upgraded":
index edf7f227d1eb25f66c2a64e1b620338deba13901..499116d8720727bcd58d716a6efb28d60311bb65 100644 (file)
@@ -13,9 +13,13 @@ define apt::sources_list (
 
   include apt::dot_d_directories
 
+  # One would expect the 'file' resource on sources.list.d to trigger an
+  # apt-get update when files are added or modified in the directory, but it
+  # apparently doesn't.
   file { "/etc/apt/sources.list.d/${name}":
     ensure => $ensure,
-    owner => root, group => 0, mode => 0644;
+    owner => root, group => 0, mode => 0644,
+    notify => Exec['refresh_apt'],
   }
 
   if $source {