]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Fix (#10451) - apt::ppa fails to "apt-get update" when new PPA source is added
authorMatthias Pigulla <mp@webfactory.de>
Wed, 2 Nov 2011 14:40:10 +0000 (15:40 +0100)
committerMatthias Pigulla <mp@webfactory.de>
Wed, 2 Nov 2011 14:40:10 +0000 (15:40 +0100)
manifests/ppa.pp

index af6eebff0a4064ec35a52d178a570c4222b41609..a41c814f296e4a4f4c8f4462208ec3242e345a69 100644 (file)
@@ -4,13 +4,6 @@ define apt::ppa() {
 
   Class['apt'] -> Apt::Ppa[$title]
 
-  Exec {
-    unless => $name? {
-      /ppa:(.*)/ => "/bin/cat /etc/apt/sources.list /etc/apt/sources.list.d/* | /bin/egrep '^[^#].*ppa.*$1.*$'",
-      default    => "/bin/cat /etc/apt/sources.list /etc/apt/sources.list.d/* | /bin/egrep '^[^#].*${title}.*$'",
-    }
-  }
-
   exec { "apt-update-${name}":
     command     => "/usr/bin/aptitude update",
     refreshonly => true,
@@ -19,6 +12,10 @@ define apt::ppa() {
   exec { "add-apt-repository-${name}":
     command => "/usr/bin/add-apt-repository ${name}",
     notify  => Exec["apt-update-${name}"],
+    unless => $name? {
+      /ppa:(.*)/ => "/bin/cat /etc/apt/sources.list /etc/apt/sources.list.d/* | /bin/egrep '^[^#].*ppa.*$1.*$'",
+      default    => "/bin/cat /etc/apt/sources.list /etc/apt/sources.list.d/* | /bin/egrep '^[^#].*${title}.*$'",
+    }
   }
 }