[chef] Re: Re: Vagrant / Berkshelf /Chef Solo


Chronological Thread 
  • From: Rob Watkin < >
  • To: Chef List < >
  • Subject: [chef] Re: Re: Vagrant / Berkshelf /Chef Solo
  • Date: Mon, 25 Nov 2013 16:12:21 +0000

Hi Nic,

Thanks for your help. I just changed the Berksfile as shown below and it works fine. Is there anyway I can get all my local cookbooks scanned without explicitly naming them?

Thanks again :-)
Rob

#Berksfile
cookbook "starter", :path => "cookbooks/starter"


#cookbooks/starter/metadata.rb
name 'starter'
description 'A basic starter cookbook'
version '1.0.0'




On 25 November 2013 15:51, Nic Grayson < " target="_blank"> > wrote:
Can you post your metadata.rb and your Berksfile?


On Mon, Nov 25, 2013 at 9:34 AM, Rob Watkin < " target="_blank"> > wrote:
Chef solo cannot find my local cookbooks. I must be doing something stupid. Any help appreciated :-)

I have berkshelf setup ok with the following in my VagrantFile

config.vm.provision :chef_solo do |chef|
    chef.cookbooks_path = "cookbooks"
    chef.add_recipe "starter" 
end

$ tree cookbooks/getting-started/
cookbooks/getting-started/
├── README.rdoc
├── attributes
│   └── default.rb
├── metadata.json
├── metadata.rb
├── recipes
│   └── default.rb
└── templates
    └── default
        └── chef-getting-started.txt.erb

If I run $ vagrant up I get:

[2013-11-25T14:55:58+00:00] INFO: *** Chef 10.14.2 ***
[2013-11-25T14:55:59+00:00] INFO: Setting the run_list to ["recipe[starter]"] from JSON
[2013-11-25T14:55:59+00:00] INFO: Run List is [recipe[starter]]
<snip>
[2013-11-25T14:55:59+00:00] ERROR: Running exception handlers
[2013-11-25T14:55:59+00:00] ERROR: Exception handlers complete
[2013-11-25T14:55:59+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2013-11-25T14:55:59+00:00] FATAL: Chef::Exceptions::CookbookNotFound: Cookbook starter not found. If you're loading starter from another cookbook, make sure you configure the dependency in your metadata

But if I run against a berkshelf cookbook e.g. (VagrantFile)
config.vm.provision :chef_solo do |chef|
    chef.cookbooks_path = "cookbooks"
    chef.add_recipe "apache2" 
end

my VM gets provioned ok

Thanks
Rob







Archive powered by MHonArc 2.6.16.

§