apt: Change how purging is managed.
[puppet-modules/puppetlabs-apt.git] / manifests / ppa.pp
index 4181b5811d3686fa4f0f9744e2f1d289a7913023..4a08dce6fd413134590962f8ad11091b171f5958 100644 (file)
@@ -28,13 +28,15 @@ define apt::ppa(
       $_require = File['sources.list.d']
     }
 
-    case $::apt::proxy_host {
-      false, '', undef: {
-        $_proxy_env = []
-      }
-      default: {
-        $_proxy_env = ["http_proxy=http://${::apt::proxy_host}:${::apt::proxy_port}", "https_proxy=http://${::apt::proxy_host}:${::apt::proxy_port}"]
+    $_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']}"]
+      } else {
+        $_proxy_env = ["http_proxy=http://${_proxy['host']}:${_proxy['port']}"]
       }
+    } else {
+      $_proxy_env = []
     }
 
     exec { "add-apt-repository-${name}":