Skip to content

Instantly share code, notes, and snippets.

@bionix
Created March 13, 2017 14:55
Show Gist options
  • Save bionix/b53310260d935320e3ccab9b0988c3a7 to your computer and use it in GitHub Desktop.
Save bionix/b53310260d935320e3ccab9b0988c3a7 to your computer and use it in GitHub Desktop.
Vagrant usage behind a proxy environment
# To install the required vagrant plugin use the following command:
# $ export http_proxy ; vagrant plugin install vagrant-proxyconf --plugin-source http://rubygems.org
#
# Add or edit your file generic Vagrantfile (in place: ~/.vagrant.d/Vagrantfile)
# To apply for all your vagrant projects the HTTP-Proxy stuff
#
# Note: vagrant needs vagrant plugin vagrant-proxyconf
#
Vagrant.configure("2") do |config|
puts "proxyconf..."
if Vagrant.has_plugin?("vagrant-proxyconf")
puts "find proxyconf plugin !"
if ENV["http_proxy"]
puts "http_proxy: " + ENV["http_proxy"]
config.proxy.http = ENV["http_proxy"]
end
if ENV["https_proxy"]
puts "https_proxy: " + ENV["https_proxy"]
config.proxy.https = ENV["https_proxy"]
end
if ENV["no_proxy"]
config.proxy.no_proxy = ENV["no_proxy"]
end
end
# optional: can bypass issues with CA-SSL-Proxies
#config.vm.box_download_insecure = true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment