From b692d9ee4a1682f0b69041856552709e2b09370f Mon Sep 17 00:00:00 2001 From: kbarczyn Date: Mon, 15 Jul 2013 20:56:26 -0700 Subject: [PATCH] Setting for the proxy environment - isolated change --- lib/vagrant-omnibus/action/install_chef.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/vagrant-omnibus/action/install_chef.rb b/lib/vagrant-omnibus/action/install_chef.rb index c707712..ebff148 100644 --- a/lib/vagrant-omnibus/action/install_chef.rb +++ b/lib/vagrant-omnibus/action/install_chef.rb @@ -63,11 +63,22 @@ def installed_version end def install(version) + if ENV["http_proxy"] + http_proxy = "export http_proxy=" + ENV["http_proxy"] + https_proxy = "export https_proxy=" + ENV["https_proxy"] + if ENV["no_proxy"] + no_proxy = "export no_proxy=" + ENV["no_proxy"] + end + end + command = <<-INSTALL_OMNIBUS + #{http_proxy} + #{https_proxy} + #{no_proxy} if command -v wget &>/dev/null; then - wget -qO- #{INSTALL_SH} | sudo bash -s -- -v #{version} + wget -qO- #{INSTALL_SH} | sudo bash -E -s -- -v #{version} elif command -v curl &>/dev/null; then - curl -L #{INSTALL_SH} -v #{version} | sudo bash + curl -L #{INSTALL_SH} -v #{version} | sudo -E bash else echo "Neither wget nor curl found. Please install one." >&2 exit 1