我尝试使用virtualbox,vagrant和chef-solo设置VM - 我想这是很常见的事情。这是我的Vagrantfile:
Vagrant::Config.run do |config|
config.vm.box = "ubuntu-13.04"
config.vm.box_url = "http://goo.gl/Y4aRr"
config.vm.network :forwarded_port, guest: 80, host: 8888
# Necessary for homesick_agent::data_bag
config.ssh.forward_agent = true
config.vm.provision :chef_solo do |chef|
# contains "users" and "ssh_known_hosts" databags
chef.data_bags_path = "databags"
chef.cookbooks_path = ["cookbooks", "site-cookbooks"]
# stuff that should be in base box
chef.add_recipe "vim"
chef.add_recipe "git"
chef.add_recipe "php"
chef.add_recipe "postgresql::server"
chef.add_recipe "chef-phppgadmin"
chef.add_recipe "apache2"
chef.add_recipe "apache2::mod_fastcgi"
chef.add_recipe "apache2::mod_php5"
chef.add_recipe "apache2::mod_ssl"
chef.add_recipe "python"
chef.add_recipe "ipynb"
chef.add_recipe "supervisor"
# chef.log_level = :debug
end
end
如您所见,我的目标框是Ubuntu。运行vagrant up
之后我得到了:
==> default: [2014-05-12T14:04:38+00:00] FATAL:
Chef::Exceptions::CookbookNotFound: Cookbook mysql not found.
If you're loading mysql from another cookbook, make sure you configure the dependency in your metadata
我不需要或想要mysql在我的盒子里!我不想要iss
,windows
以及厨师抱怨的所有其他不同套餐。起初我一个接一个地下载它们但它看起来很傻,所以我想,我做错了什么。任何提示?
答案 0 :(得分:1)
metadata.rb
中定义了相关的烹饪书,则需要它们。虽然它们可能无法在您的平台上执行,但Chef并没有条件依赖的概念。::
来分隔cookbook::recipe
,而不是单个:
(当它在搜索名为postgresql:server
的食谱及其默认配方时,这会给您带来麻烦。