【问题标题】:chef test-kitchen configuration for Vagrant ssh connect timeoutVagrant ssh 连接超时的厨师测试厨房配置
【发布时间】:2016-04-02 20:27:16
【问题描述】:

我的 google-fu 让我失望了。我需要在我的 .kitchen.yml 中添加什么才能让它增加 config.vm.boot_timeout 或我的 Vagrantfile 中的尝试次数。我的厨房汇聚几乎总是命中:

  STDERR: Timed out while waiting for the machine to boot. This means that
  Vagrant was unable to communicate with the guest machine within
  the configured ("config.vm.boot_timeout" value) time period.

大约再过一分钟左右,我就可以毫无问题地连接了。

我已经尝试了许多我认为可能的方法,但似乎没有一个将其设置为以下所有:

driver:
  name: vagrant
  vm.boot_timeout: 20
  vm:
    boot_timeout: 20

driver_config:
  require_chef_omnibus: true
  vm.boot_timeout: 20
  vm:
    boot_timeout: 20

我需要做些什么来增加这个值?

【问题讨论】:

    标签: unit-testing chef-infra vagrantfile test-kitchen


    【解决方案1】:

    我补充说:

    驱动程序:
      姓名:流浪者
      boot_timeout: 1200

    它似乎可以工作,boot_timout 已经存在于 Vagantfile.erb 中,可能是因为版本较新。

    【讨论】:

      【解决方案2】:

      这个不直接支持,但是你可以复制default Vagrantfile.erb并设置

      driver:
        name: vagrant
        vagrantfile_erb: path/to/your/Vagrantfile.erb
      

      或者可能:(我忘记了需要哪个)

      driver:
        name: vagrant
        config:
          vagrantfile_erb: path/to/your/Vagrantfile.erb
      

      【讨论】:

      • 我在最后几分钟发现了这个:gist.github.com/mattstratton/9095916 我现在正在那里测试它是否有效。
      • boot_timeout 不是一个选项,您可以在默认的 Vagrantfile 模板中看到。
      • 这似乎也没有解决它。
      • 在我的 chefdk 安装中找到 /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/kitchen-vagrant-0.15.0/templates/Vagrantfile.erb。我尝试将其直接修补到此文件中,但似乎没有更新。
      • 您的意思是 vagrantfile_erb 选项不起作用吗?如果是这样,请在 config: 子项下尝试。我忘记了哪些案例要求这样做。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-15
      • 1970-01-01
      相关资源
      最近更新 更多