1

When I run kitchen test on my MacBook, it gets through most of the steps, but then gets stuck here twiddling its thumbs:

       Running handlers:
       Running handlers complete
       Chef Client finished, 81/117 resources updated in 07 minutes 12 seconds
       Finished converging <default-ubuntu-1404> (7m42.70s).
-----> Setting up <default-ubuntu-1404>...
       Finished setting up <default-ubuntu-1404> (0m0.00s).
-----> Verifying <default-ubuntu-1404>...
       Preparing files for transfer
-----> Installing Busser (busser)
Fetching: thor-0.19.0.gem (100%)
       Successfully installed thor-0.19.0
Fetching: busser-0.7.1.gem (100%)
       Successfully installed busser-0.7.1
       2 gems installed
       Installing Busser plugins: busser-serverspec

Several hours later, still says the same thing. No progress. Oddly, it never errors or times out, either - just keeps waiting for something. And it doesn't happen on my work MacBook, only my home one (late 2011 - old, but still effective).

Mac OS 10.11.4 (El Capitan), ChefDK 0.13.21, Virtualbox 5.0.20, Kitchen.yml:

---
driver:
  name: vagrant

provisioner:
  name: chef_solo

platforms:
  - name: ubuntu-14.04

suites:
  - name: default
    data_bags_path: "test/integration/data_bags" 
    run_list:
      - recipe[devserver::default]
    attributes:

Any ideas? Ways I can dig deeper and debug? Solutions? Thanks!

4

1 回答 1

4

好吧,我把食谱的一些片段一个一个地复制到一本新的食谱上,然后弄明白了。问题是用户 cookbooksudo cookbook和 Vagrant之间的冲突。

tl; dr sudo 食谱剥夺了“流浪”用户的权力。我想busser被卡住了等待输入密码或其他东西。为了解决这个问题,我将以下内容添加到我的.kitchen.yml

suites:
  - name: default
    run_list:
      - recipe[mycookbook::default]
    data_bags_path: "test/integration/data_bags" 
    attributes:
      authorization:
        sudo:
          passwordless: true
          users: ['vagrant']

这让 vagrant 用户可以在没有密码的情况下运行 sudo 命令,并且 busser 可以再次安装其插件。

如果我的 google-fu 稍微好一点,我可能会找到其他有类似问题的人。希望互联网上的问题+答案的另一个副本将使其他人更容易弄清楚。

于 2016-05-01T20:26:25.833 回答