我的厨师厨房的Vagrant机器无法访问互联网

时间:2018-12-13 18:57:41

标签: vagrant chef test-kitchen

我正在尝试学习如何在本地开发厨师食谱。我正在遵循本指南https://gist.github.com/smford22/f00f46471047422bd8a7

我为所有厨房命令添加了chef exec前缀,因为如果我尝试直接运行厨房,会遇到各种红宝石/宝石错误。

运行chef exec kitchen converge时,它卡在安装Chef Omnibus上,挂在“正在尝试wget ...”上。

如果我登录到VM并尝试运行curl和wget命令,例如curl https://google.com,则确实无法访问Internet。

chef exec kitchen -v
Test Kitchen version 1.23.2

chef -v
Chef Development Kit Version: 3.5.13
chef-client version: 14.7.17
delivery version: master (6862f27aba89109a9630f0b6c6798efec56b4efe)
berks version: 7.0.6
kitchen version: 1.23.2
inspec version: 3.0.52

.kitchen.yml:

---
driver:
  name: vagrant

 ## The private_network feature lets you setup a private network on the VM guest
 ## via localhost on the host.
 ## see also: https://www.vagrantup.com/docs/networking/private_network.html

  # network:
  #  - ["private_network", {ip: "33.33.33.33"}]

provisioner:
  name: chef_zero

## The verifier section determines which test platform you want to use.
verifier:
  name: inspec
  format: doc

platforms:
  - name: centos-6.7

suites:
  - name: default
    run_list:
      - recipe[chef_httpd::default]
    attributes:

1 个答案:

答案 0 :(得分:0)

您是否通过代理访问互联网? 如果是,则需要使用vagrant-proxyconf插件为Vagrant VM配置相同的配置。 文档:http://tmatilai.github.io/vagrant-proxyconf/