stop including params everywhere
[puppet-modules/puppetlabs-apt.git] / manifests / ppa.pp
index 8a3b6f5f594e136113d697f5e89e73eeb61213f0..f6c7373d8d3c599c5126d980f2136a47766e67e7 100644 (file)
@@ -5,7 +5,6 @@ define apt::ppa(
   $release = $::lsbdistcodename,
   $options = $apt::params::ppa_options,
 ) {
-  include apt::params
   include apt::update
 
   $sources_list_d = $apt::params::sources_list_d
@@ -15,7 +14,7 @@ define apt::ppa(
   }
 
   if $::operatingsystem != 'Ubuntu' {
-    fail("apt::ppa is currently supported on Ubuntu only.")
+    fail('apt::ppa is currently supported on Ubuntu only.')
   }
 
   $filename_without_slashes = regsubst($name, '/', '-', 'G')
@@ -36,23 +35,25 @@ define apt::ppa(
     if defined(Class[apt]) {
         $proxy_host = $apt::proxy_host
         $proxy_port = $apt::proxy_port
-        case  $proxy_host {
-        false, '': {
+        case $proxy_host {
+          false, '', undef: {
             $proxy_env = []
-        }
-        default: {$proxy_env = ["http_proxy=http://${proxy_host}:${proxy_port}", "https_proxy=http://${proxy_host}:${proxy_port}"]}
+          }
+          default: {
+            $proxy_env = ["http_proxy=http://${proxy_host}:${proxy_port}", "https_proxy=http://${proxy_host}:${proxy_port}"]
+          }
         }
     } else {
         $proxy_env = []
     }
     exec { "add-apt-repository-${name}":
-        environment  => $proxy_env,
-        command      => "/usr/bin/add-apt-repository ${options} ${name}",
-        unless       => "/usr/bin/test -s ${sources_list_d}/${sources_list_d_filename}",
-        user         => 'root',
-        logoutput    => 'on_failure',
-        notify       => Exec['apt_update'],
-        require      => [
+        environment => $proxy_env,
+        command     => "/usr/bin/add-apt-repository ${options} ${name}",
+        unless      => "/usr/bin/test -s ${sources_list_d}/${sources_list_d_filename}",
+        user        => 'root',
+        logoutput   => 'on_failure',
+        notify      => Exec['apt_update'],
+        require     => [
         File['sources.list.d'],
         Package[$package],
         ],
@@ -67,9 +68,6 @@ define apt::ppa(
 
     file { "${sources_list_d}/${sources_list_d_filename}":
         ensure => 'absent',
-        mode   => '0644',
-        owner  => 'root',
-        gruop  => 'root',
         notify => Exec['apt_update'],
     }
   }