我正試圖用Berkshelf來管理食譜。下面是步驟如何使用Berkshelf與廚師獨奏?
$ berks init # and use a custom Vagrant box image
$ vim Berksfile # and put cookbook 'git'
$ berks install
$ vagrant up
我希望最後一步以供應與git
食譜VM,但我得到:
$ bin/vagrant up /Users/pmu/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/hashie-2.0.0/lib/hashie/mash.rb:80: warning: redefining `object_id' may cause serious problems [default] Importing base box 'Ubuntu-11.04'... [default] Matching MAC address for NAT networking... [default] Clearing any previously set forwarded ports... [default] Forwarding ports... [default] -- 22 => 2222 (adapter 1) [Berkshelf] installing cookbooks... [Berkshelf] Using git (2.3.0) [Berkshelf] Using dmg (1.1.0) [Berkshelf] Using build-essential (1.3.4) [Berkshelf] Using yum (2.1.0) [Berkshelf] Using windows (1.8.4) [Berkshelf] Using chef_handler (1.1.4) [Berkshelf] Using runit (1.0.6) [default] Creating shared folders metadata... [default] Clearing any previously set network interfaces... [default] Preparing network interfaces based on configuration... [default] Booting VM... [default] Waiting for VM to boot. This can take a few minutes. [default] VM booted and ready for use! [default] Configuring and enabling network interfaces... [default] Setting host name... [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... stdin: is not a tty [2013-02-24T12:51:04+00:00] INFO: *** Chef 10.18.2 *** [2013-02-24T12:51:05+00:00] INFO: Setting the run_list to ["recipe[berkshelf-test::default]"] from JSON [2013-02-24T12:51:05+00:00] INFO: Run List is [recipe[berkshelf-test::default]] [2013-02-24T12:51:05+00:00] INFO: Run List expands to [berkshelf-test::default] [2013-02-24T12:51:05+00:00] INFO: Starting Chef Run for ubuntu-11.04 [2013-02-24T12:51:05+00:00] INFO: Running start handlers [2013-02-24T12:51:05+00:00] INFO: Start handlers complete. [2013-02-24T12:51:05+00:00] ERROR: Running exception handlers [2013-02-24T12:51:05+00:00] ERROR: Exception handlers complete [2013-02-24T12:51:05+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out [2013-02-24T12:51:05+00:00] FATAL: Chef::Exceptions::CookbookNotFound: Cookbook berkshelf-test not found. If you're loading berkshelf-test from another cookbook, make sure you configure the dependency in your metadata Chef never successfully completed! Any errors should be visible in the output above. Please fix your recipes so that they properly complete.
在Vagrantfile廚師獨奏部分:
config.vm.provision :chef_solo do |chef| chef.json = { :mysql => { :server_root_password => 'rootpass', :server_debian_password => 'debpass', :server_repl_password => 'replpass' } } chef.run_list = [ "recipe[berkshelf-test::default]" ] end
謝謝!的確,我的困惑是關於Berkshelf如何設置run_list,而它所指的Cookbook不存在。 – poseid 2013-02-24 13:27:41
在我的情況下,我必須添加我的自定義食譜: 'berks cookbook my_custom_cookbook' from target cookbook folder。然後: 'berks安裝' 也許它可以幫助任何人。 – ebaranov 2014-03-10 20:10:07