Pergunta

I'm trying to set up VM using virtualbox, vagrant, and chef-solo - I guess this is pretty common thing to do. This is my 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

As you see my target box is Ubuntu. And after running vagrant up I'm getting:

 ==> 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

I don't need or want mysql in my box! Neither I want iss, windows and all other different packages chef is complaining about. At first I was downloading them one by one but it looks silly, so I guess, I'm doing something wrong. Any hints?

Foi útil?

Solução

  • Use a dependency resolver like Berkshelf to automatically download cookbook dependencies
  • You need the dependent cookbooks, if they are defined in a metadata.rb. Although they might not get executed on your platform, chef does not have a concept for conditional dependencies.
  • Your notation is wrong. Chef uses :: to separate cookbook::recipe, not a single : (this will bring you trouble later, when it's searching for a cookbook called postgresql:server and its default recipe.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top