From 197d9389b458fcd681df1c591c27694cfa37f731 Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Mon, 8 Nov 2010 16:44:30 +0200 Subject: [PATCH] Added http proxy support to custom::file --- custom/manifests/init.pp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/custom/manifests/init.pp b/custom/manifests/init.pp index 23f28d3..9bd6ab7 100644 --- a/custom/manifests/init.pp +++ b/custom/manifests/init.pp @@ -67,11 +67,15 @@ define custom::file($ensure, $group="NONE", $mode="NONE", $owner="NONE", $seltyp "puppet": {} default: { exec { "fetch-file-${source}": - path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin", - cwd => regsubst($name, '(.*)/[^/]+$', '\1'), - command => $fetch_cmd, - unless => $diff_cmd, - before => File["${name}"], + environment => $http_proxy ? { + "" => undef, + default => "http_proxy=${http_proxy}", + }, + path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin", + cwd => regsubst($name, '(.*)/[^/]+$', '\1'), + command => $fetch_cmd, + unless => $diff_cmd, + before => File["${name}"], } } }