reformatted apt::ppa according to recommended
[puppet-modules/puppetlabs-apt.git] / manifests / ppa.pp
index 75f0a69574368316f4540567d00b92383645391b..dd2143e246aea2e35e46bf69ba2004b29a9bec20 100644 (file)
@@ -1,13 +1,17 @@
 # ppa.pp
 
-define apt::ppa(
-       
-) {
-       include apt
-       
-       exec { "/usr/bin/add-apt-repository ${name}":
-               require => Package["python-software-properties"],
-               # TODO: unless => 'check'
-       }
+define apt::ppa() {
+
+  Class['apt'] -> Apt::Ppa[$title]
+
+    exec { "apt-update-${name}":
+        command     => "/usr/bin/aptitude update",
+        refreshonly => true,
+    }
+
+    exec { "add-apt-repository-${name}":
+        command => "/usr/bin/add-apt-repository ${name}",
+        notify  => Exec["apt-update-${name}"],
+    }
 }