(#12823) Add apt::key defined type and modify apt::source to use it
[puppet-modules/puppetlabs-apt.git] / manifests / ppa.pp
index 8dcea856ede5c7e64580714137cfae50b86638fe..a41c814f296e4a4f4c8f4462208ec3242e345a69 100644 (file)
@@ -12,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}.*$'",
+    }
   }
 }