【问题标题】:chef remote file fails behind proxy厨师远程文件在代理后面失败
【发布时间】:2014-07-29 19:09:01
【问题描述】:

我正在我的厨师食谱中运行以下远程文件命令。我无法让它使用代理。 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

我的代理设置了以下环境变量

HTTP_PROXY

HTTPS_PROXY

http_proxy

https_proxy

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

【问题讨论】:

    标签: proxy chef-infra cookbook


    【解决方案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"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-03-26
      • 2014-10-25
      • 1970-01-01
      • 2014-01-03
      • 1970-01-01
      • 1970-01-01
      • 2019-08-03
      相关资源
      最近更新 更多