有一个vagrant-proxyconf 插件,所以你应该通过 vagrant 来配置你的代理,以便在正常的 up/provision 步骤中运行所有东西(一次全部完成)
你应该能够做这样的事情
Vagrant.configure("2") do |config|
config.proxy.http = "http://192.168.0.2:3128/"
config.proxy.https = "http://192.168.0.2:3128/"
# in any subsequent command the proxy is enabled
# override parameter for the shell provisioner
config.vm.define "instance" do |instance|
instance.proxy.enabled = false
instance.vm.provision :shell do |shell|
shell.path = "install-puppet-modules.sh"
end
end
在我的情况下,install-pupper-modules
脚本将从 puppet forge 下载一堆模块,它的工作原理就像我评论instance.proxy.enabled = false
它无法连接(我没有配置代理)