Vagrant 改变厨房流浪汉从哪里下载厨师

Vagrant 改变厨房流浪汉从哪里下载厨师,vagrant,chef-infra,test-kitchen,Vagrant,Chef Infra,Test Kitchen,我正在用虚拟流浪者的测试厨房做一些厨师食谱测试。每次我运行厨房测试,它都会从standard place(亚马逊)下载一份chef omnibus安装程序。问题是我在家,每次下载都需要时间,而且会增加我每月的网络使用量 有没有办法配置test kitchen/kitchen vagrant/任何东西,以便下载来自本地缓存?如果我在电脑上设置了缓存代理Web服务器,我可以让test kitchen配置vagrant实例以用于chef下载吗?是-该过程在中有说明,但简而言之: 在.kitchen.y

我正在用虚拟流浪者的测试厨房做一些厨师食谱测试。每次我运行
厨房测试
,它都会从standard place(亚马逊)下载一份chef omnibus安装程序。问题是我在家,每次下载都需要时间,而且会增加我每月的网络使用量


有没有办法配置test kitchen/kitchen vagrant/任何东西,以便下载来自本地缓存?如果我在电脑上设置了缓存代理Web服务器,我可以让test kitchen配置vagrant实例以用于chef下载吗?

是-该过程在中有说明,但简而言之:

.kitchen.yml中使用ERB:

<%
require 'socket'

def local_ip
  @local_ip ||= begin
    # turn off reverse DNS resolution temporarily
    orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true

    UDPSocket.open do |s|
      s.connect '64.233.187.99', 1
      s.addr.last
    end
  ensure
    Socket.do_not_reverse_lookup = orig
  end
end

def local_port ; 8123 ; end
def http_proxy_url ; "http://#{local_ip}:#{local_port}" ; end

def proxy_running?
  socket = TCPSocket.new(local_ip, local_port)
  true
rescue SocketError, Errno::ECONNREFUSED,
  Errno::EHOSTUNREACH, Errno::ENETUNREACH, IOError
  false
rescue Errno::EPERM, Errno::ETIMEDOUT
  false
ensure
  socket && socket.close
end
%>
---
<% if proxy_running? %>
driver:
  http_proxy: <%= http_proxy_url %>
  https_proxy: <%= http_proxy_url %>
  provision_command: "env http_proxy=<%= http_proxy_url %> bash -c 'curl -L http://www.getchef.com/chef/install.sh | bash'"

provisioner:
  chef_omnibus_url: http://www.getchef.com/chef/install.sh
<% end %>

---
司机:
http_代理:
https\u代理:
provision_命令:“env http_proxy=bash-c'curl-Lhttp://www.getchef.com/chef/install.sh |巴什“
供应人:
厨师长综合网址:http://www.getchef.com/chef/install.sh
运行代理的说明使用polipo,但您可以使用任何缓存代理