【发布时间】:2014-02-04 16:22:10
【问题描述】:
我正在尝试使用来自this box 的 Vagrant 启动实例,然后启动我的 Chef 食谱。 Vagrant文件:
Vagrant::Config.run do |config|
config.vm.box = "sausy64"
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/saucy/20131113/saucy-server-cloudimg-amd64-vagrant-disk1.box"
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "."
chef.add_recipe "test"
end
end
运行vagrant up 后我得到:
[default] Importing base box 'sausy64'...
[default] Matching MAC address for NAT networking...
[default] Clearing any previously set forwarded ports...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Mounting shared folders...
[default] -- v-root: /vagrant
[default] -- v-csc-1: /tmp/vagrant-chef-1/chef-solo-1/cookbooks
[default] Running provisioner: Vagrant::Provisioners::ChefSolo...
[default] Generating chef JSON and uploading...
[default] Running chef-solo...
[2013-11-16T18:15:15+00:00] INFO: *** Chef 10.12.0 ***
[2013-11-16T18:15:16+00:00] INFO: Setting the run_list to ["recipe[test]"] from JSON
[2013-11-16T18:15:16+00:00] INFO: Run List is [recipe[test]]
[2013-11-16T18:15:16+00:00] INFO: Run List expands to [test]
[2013-11-16T18:15:16+00:00] INFO: Starting Chef Run for vagrant-ubuntu-saucy-64
[2013-11-16T18:15:16+00:00] INFO: Running start handlers
[2013-11-16T18:15:16+00:00] INFO: Start handlers complete.
bash: line 2: 1494 Killed chef-solo -c /tmp/vagrant-chef-1/solo.rb -j /tmp/vagrant-chef-1/dna.json
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
我使用vagrant ssh 来检查发生了什么,似乎无法访问共享文件夹cookbooks。
vagrant@vagrant-ubuntu-saucy-64:~$ cd /tmp/vagrant-chef-1/chef-solo-1/cookbooks/
vagrant@vagrant-ubuntu-saucy-64:/tmp/vagrant-chef-1/chef-solo-1/cookbooks$ ls
... CPU goes to 100% and anything shows ...
我应该怎么做才能让它工作?
【问题讨论】:
标签: ubuntu virtualbox chef-infra vagrant