Add call to apt-update after add-apt-repository in apt::ppa
authorBen Godfrey <ben.godfrey@wonga.com>
Fri, 11 Mar 2011 18:14:31 +0000 (18:14 +0000)
committerBen Godfrey <Ben Godfrey ben@ben2.com>
Fri, 11 Mar 2011 18:14:31 +0000 (18:14 +0000)
manifests/ppa.pp

index c9ab9559b0029ca3fad5b9167111178169670aff..2821051a9902d4d85e89791e85f2d69bdd781cac 100644 (file)
@@ -7,9 +7,14 @@ define apt::ppa(
 
     package { "python-software-properties": }
 
-       exec { "/usr/bin/add-apt-repository ${name}":
-               require => Package["python-software-properties"],
-               # TODO: unless => 'check'
-       }
+    exec { "apt-update":
+        command     => "/usr/bin/apt-get update",
+        refreshonly => true,
+    }
+
+    exec { "/usr/bin/add-apt-repository ${name}":
+        require => Package["python-software-properties"],
+        notify => Exec["apt-update"]
+    }
 }