- From: Noah Kantrowitz <
>
- To:
- Subject: [chef] Re: Chef resources in vagrant provisioning
- Date: Sun, 2 Mar 2014 12:42:32 -0800
You need to load the cookbook as "hosts" instead of "nd-chef-hosts". It
doesn't have the name in the metadata so falls back on using the folder name,
which isn't correct in this case. The issue is that LWRPs are names
automatically based on the name of the cookbook they are in.
--Noah
On Mar 2, 2014, at 4:51 AM, Suresh Prajapati
<
>
wrote:
>
Hi,
>
>
I am trying to use this cookbook
>
"https://github.com/cookbooks/nd-chef-hosts"
>
>
As per readme file I've created a vagrant file like this
>
>
VAGRANTFILE_API_VERSION = "2"
>
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
>
config.vm.box = "lucid64-customized"
>
config.vm.network :public_network
>
config.vm.provision :chef_solo do |chef|
>
chef.cookbooks_path = "cookbooks"
>
chef.add_recipe "nd-chef-hosts::example"
>
#chef.log_level = :debug
>
end
>
>
but when i "vagrant up --provision" . It throws this error
>
>
NoMethodError
>
-------------
>
No resource or method named `hosts' for `Chef::Recipe "example"'
>
>
>
Cookbook Trace:
>
---------------
>
>
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/nd-chef-hosts/recipes/example.rb:6:in
>
`from_file'
>
>
>
Relevant File Content:
>
----------------------
>
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/nd-chef-hosts/recipes/example.rb:
>
>
>
I've googled a lot but was not able to find the resolution for this problem.
>
>
Please help .
>
>
~cheers
Attachment:
signature.asc
Description: Message signed with OpenPGP using GPGMail
Archive powered by MHonArc 2.6.16.