Merge pull request #543 from puppetlabs/revert-542-fix_apt_params
[puppet-modules/puppetlabs-apt.git] / manifests / ppa.pp
index 4a08dce6fd413134590962f8ad11091b171f5958..f3e2bfda040c82f3890fce47947949590c04c338 100644 (file)
@@ -1,17 +1,17 @@
 # ppa.pp
 define apt::ppa(
   $ensure         = 'present',
-  $release        = $::lsbdistcodename,
   $options        = $::apt::ppa_options,
+  $release        = $::apt::xfacts['lsbdistcodename'],
   $package_name   = $::apt::ppa_package,
   $package_manage = false,
 ) {
-  if ! $release {
+  unless $release {
     fail('lsbdistcodename fact not available: release parameter required')
   }
 
-  if $::operatingsystem != 'Ubuntu' {
-    fail('apt::ppa is currently supported on Ubuntu only.')
+  if $::apt::xfacts['lsbdistid'] == 'Debian' {
+    fail('apt::ppa is not currently supported on Debian.')
   }
 
   $filename_without_slashes = regsubst($name, '/', '-', 'G')
@@ -31,9 +31,9 @@ define apt::ppa(
     $_proxy = $::apt::_proxy
     if $_proxy['host'] {
       if $_proxy['https'] {
-        $_proxy_env = ["http_proxy=http://${_proxy['host']}:${_proxy['port']}", "https_proxy=https://${_proxy['host']}:${_proxy['port']}"]
+        $_proxy_env = ["http_proxy=http://${$_proxy['host']}:${$_proxy['port']}", "https_proxy=https://${$_proxy['host']}:${$_proxy['port']}"]
       } else {
-        $_proxy_env = ["http_proxy=http://${_proxy['host']}:${_proxy['port']}"]
+        $_proxy_env = ["http_proxy=http://${$_proxy['host']}:${$_proxy['port']}"]
       }
     } else {
       $_proxy_env = []
@@ -60,9 +60,4 @@ define apt::ppa(
       notify => Exec['apt_update'],
     }
   }
-
-  # Need anchor to provide containment for dependencies.
-  anchor { "apt::ppa::${name}":
-    require => Class['apt::update'],
-  }
 }