From c21730c01de7ace9713f914636a539e2a310b116 Mon Sep 17 00:00:00 2001 From: Pierre Gambarotto Date: Thu, 11 Jul 2013 15:29:38 +0200 Subject: [PATCH] proxy support for apt::ppa --- manifests/ppa.pp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/manifests/ppa.pp b/manifests/ppa.pp index 725170d2dc..f234f748e7 100644 --- a/manifests/ppa.pp +++ b/manifests/ppa.pp @@ -26,7 +26,20 @@ package { $package: } } + if defined(Class[apt]) { + $proxy_host = getparam(Class[apt], "proxy_host") + $proxy_port = getparam(Class[apt], "proxy_port") + case $proxy_host { + false: { + $proxy_env = "" + } + 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 ${name}", creates => "${sources_list_d}/${sources_list_d_filename}", logoutput => 'on_failure',