【问题标题】:My Vagrant machine from chef kitchen cannot access the internet我的厨师厨房的 Vagrant 机器无法访问互联网
【发布时间】:2018-12-16 18:57:57
【问题描述】:

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

我在所有厨房命令前加上chef exec,因为如果我尝试直接运行厨房,我会收到各种 ruby​​/gem 错误。

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

如果我登录虚拟机并尝试运行 curl 和 wget 命令,例如curl https://google.com,它确实无法访问互联网。

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:

【问题讨论】:

    标签: vagrant chef-infra test-kitchen


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多