From 0d25368ce717319d8167f611c2f9e3f30dce3352 Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Wed, 9 Mar 2011 14:02:43 +0200 Subject: [PATCH] Fixed http_proxy handling in apt::repo --- apt/manifests/init.pp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apt/manifests/init.pp b/apt/manifests/init.pp index 2279881..ca3e0be 100644 --- a/apt/manifests/init.pp +++ b/apt/manifests/init.pp @@ -228,6 +228,12 @@ define apt::repo($source, $dist="", $components="main", $key="", $keyserver="", $source_real = $source } + if $http_proxy and $use_proxy { + $http_proxy_real = $http_proxy + } else { + $http_proxy_real = "" + } + if $use_source { $content = "deb ${source_real} ${dist_real} ${components}\ndeb-src ${source_real} ${dist_real} ${components}\n" } else { @@ -254,9 +260,9 @@ define apt::repo($source, $dist="", $components="main", $key="", $keyserver="", } exec { "apt-key-add-${key}": - environment => $http_proxy ? { + environment => $http_proxy_real ? { "" => undef, - default => "http_proxy=${http_proxy}", + default => "http_proxy=${http_proxy_real}", }, path => "/bin:/usr/bin:/sbin:/usr/sbin", command => $command,