主厨远程文件在代理后失败

时间:2014-07-29 19:09:01

标签: proxy chef cookbook

我在我的厨师食谱中运行以下远程文件命令。我无法让它使用代理。 git命令将使用代理,所以其他任何东西,但在使用remote file

时失败
remote_file "Fetch the latest ca-bundle" do
  source "http://curl.haxx.se/ca/cacert.pem"
  path "/opt/local/etc/certs/cacert.pem"
  owner "git"
  group "git"
  mode 0755
  action :create
end

错误:

Error connecting to http://curl.haxx.se/ca/cacert.pem - getaddrinfo: Name or service not known

我有以下代理

设置的env变种

HTTP_PROXY

HTTPS_PROXY

HTTP_PROXY

https_proxy

有没有办法在命令中定义代理?

1 个答案:

答案 0 :(得分:1)

您需要在client.rb

中设置代理设置
# HTTP for environment behind firewall
# http://docs.opscode.com/config.html
# solo.rb and client.rb can use the same http_proxy settings
http_proxy "http://proxy.company.com:3128"
http_proxy_user "username"
http_proxy_pass "password"