在Vagrant&Puppet上使用代理

我试图运行一个木偶清单,这取决于具有代理设置的目标机器访问Internet。

我没有能够通过http_proxy_host木偶build议(我相信它的错误?)。

我试图更新我的Debian框中的.bashrc(通过木偶清单),虽然我不知道如何获得第一次的设置。

相反,我相信一个解决scheme将是设置/通过env var http_proxy但我不知道如何/在哪里做到这一点与stream浪汉。

https://groups.google.com/d/msg/puppet-users/2aivOoYHwZ0/rjRkJx1zdjQJbuild议使用像这样的包装…

#!/bin/bash export http_proxy=my.proxy puppet apply "$@" 

我不是100%确定在哪里做到这一点,或者如果这是最好的解决scheme。

当然,我不是唯一试图使用stream浪汉/木偶和代理的人?

尝试像这样设置你的代理:

 #!/bin/bash export http_proxy=http://my.proxy:3128 puppet apply "$@" 

在Puppetconfiguration器之前 ,我在Vagrantfile中使用了一个shellconfiguration器:

 config.vm.provision :shell, :inline => "echo 'export http_proxy=http://proxy.company.com:3128' >> /etc/profile.d/proxy.sh" 

我有点偏见,但我会build议使用vagrant-proxyconf插件。 要configuration所有Vagrant机器,您可以使用$ HOME / .vagrant.d / Vagrantfile或环境variables。 这样你就不需要修改所有项目特定的stream浪文件。

例:

 Vagrant.configure("2") do |config| config.proxy.http = "http://my.proxy:3128" config.proxy.https = "http://my.proxy:3128" # other configuration... end