Merge branch 'master' of https://github.com/puppetlabs/puppetlabs-apt
[puppet-modules/puppetlabs-apt.git] / manifests / ppa.pp
index 9527e0d624d3113fa0f72a20d55e5364c3e6a4c2..725170d2dc39dfb9c8b51841b795a8d467cb480c 100644 (file)
@@ -17,16 +17,23 @@ define apt::ppa(
   $filename_without_ppa     = regsubst($filename_without_dots, '^ppa:', '', G)
   $sources_list_d_filename  = "${filename_without_ppa}-${release}.list"
 
-  if ! defined(Package['python-software-properties']) {
-    package { 'python-software-properties': }
+  $package = $::lsbdistrelease ? {
+    /^[1-9]\..*|1[01]\..*|12.04$/ => 'python-software-properties',
+    default  => 'software-properties-common',
+  }
+
+  if ! defined(Package[$package]) {
+    package { $package: }
   }
 
   exec { "add-apt-repository-${name}":
     command   => "/usr/bin/add-apt-repository ${name}",
     creates   => "${sources_list_d}/${sources_list_d_filename}",
     logoutput => 'on_failure',
-    require   => [ File[$sources_list_d],
-                   Package['python-software-properties'] ],
+    require   => [
+      File[$sources_list_d],
+      Package["${package}"],
+    ],
     notify    => Exec['apt_update'],
   }
 
@@ -40,4 +47,3 @@ define apt::ppa(
     require => Class['apt::update'],
   }
 }
-