厨师真让我困惑。你能帮我理解为什么它不起作用吗?
悬崖笔记
vagrant provision
vmboxmanage box destroy ubuntu/trusty64
并重新下载所有内容并重做vagrant up
。内部流氓SSH错误:
注意:文件未指向.chef
文件夹,但它们在这里?
[2015-01-30T16:23:44+00:00] WARN: Did not find config file:
/etc/chef/solo.rb, using command line options.
[2015-01-30T16:23:50+00:00] FATAL: None of the cookbook paths set in
Chef::Config[:cookbook_path],
["/vagrant/.chef/cookbooks", "/vagrant/.chef/site-cookbooks"],
contain any cookbooks
$ vagrant up和$ vagrant provision error:
==> default: Mounting shared folders...
default: /vagrant => /home/jesse/if/indieflix/vagrant
default: /home/vagrant/chef-recipes => /home/jesse/projects/if/vagrant/chef-recipes
default: /home/vagrant/chef-resources => /home/jesse/projects/if/vagrant/chef-resources
==> default: Running provisioner: chef_solo...
==> default: Detected Chef (latest) is already installed
Shared folders that Chef requires are missing on the virtual machine.
This is usually due to configuration changing after already booting the
machine. The fix is to run a `vagrant reload` so that the proper shared
folders will be prepared and mounted on the VM.
并且vagrant reload
什么也没做。
Vagrantfile
# ...
config.vm.synced_folder "chef-recipes", "/vagrant/chef-recipes"
config.vm.synced_folder "chef-resources", "/vagrant/chef-resources"
# ...
config.vm.provision "chef_solo" do |chef|
# Relevant to the Vagrantfile path
chef.cookbooks_path = ["chef-recipes"]
# This is just required by Chef, so it's minimal
chef.environments_path = "chef-resources/environments"
# This is the internal flag.
chef.environment = "development"
# This defines the cookbooks to run
chef.roles_path = "chef-resources/roles"
chef.add_role("development")
end
文件夹结构
chef-recipes/ (Git Submodule)
----python/
--------recipes/
------------default.rb
------------pip.rb
chef-resouces/ (Git Submodule)
----environments/
--------development.json
----roles/
--------development.json
Vagranfile
答案 0 :(得分:4)
安东尼在评论中建议我回答我的问题,因为它已在评论中得到回答。在这里!
我没有使用curl来安装,而是使用了omnibus,它在配置之前增加了另一个步骤:
$ vagrant plugin install vagrant-omnibus
其次,Chef-Solo / Vagrant在从主机安装文件时遇到问题。我找到的唯一解决方法是:
$ rm .vagrant/machines/default/virtualbox/synced_folders vagrant reload --provision
可选:我创建了一个bash脚本,使上述内容更快一些:
<强> reprovision.sh 强>
#/bin/bash
rm .vagrant/machines/default/virtualbox/synced_folders
vagrant reload --provision
当然chmod +x reprovision.sh
并运行./reprovision.sh