- From: Sébastien Nicouleaud <
>
- To:
- Subject: [chef] Re: Re: Re: Re: chef-solo + cookbooks development
- Date: Thu, 21 Oct 2010 09:24:53 +0200
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; b=pfjhnTgbDx+P/ytwR/NtV6h5z8hQImUInHFaKvWskMC8E/Y14cOVsXZ5i/Uegm3ALw 2qUh6k9iw6tVNem/PjFwlNF/5E93iJPw3n4TkV6loWrtatETWASPfDfKK9CnfgbKeiqf R3ORV1jJyvGpLTsOP41XssvkTco/AV04Pr3AM=
Thank you very much for your help.
I found the vagrant website 5 minutes before reading your email, so your
answer confirms my thoughts.
Cheers,
Seb
Le mercredi 20 octobre 2010 à 08:58 -0600, Andrew Shafer a écrit :
>
Just eyeballing, it looks like some how 'current_dir' isn't getting
>
set to what you expect probably because of a nuance of how chef loads
>
the file.
>
>
You can trouble shoot that if you like, but I highly recommend you
>
check out vagrant.
>
>
vagrant is a great way to dev cookbooks.
>
>
If you like virtualbox, chances are you'll love vagrant.
>
>
I do.
>
>
>
>
2010/10/20 Sébastien Nicouleaud
>
<
>:
>
> Thanks, Dreamcat4.
>
> I found the rake task, but it is just a wrapper for knife.
>
>
>
> It finally worked by creating a .chef/knife.rb file containing:
>
> node_name "virtualbox"
>
>
>
> But it keeps complaining about the missing cookbook.
>
> Running chef-client with strace gives the following:
>
>
>
> $ sudo strace chef-solo -c solo.rb -l debug 2>&1 | grep cookbooks
>
> open("/cookbooks", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|
>
> O_CLOEXEC) = -1 ENOENT (No such file or directory)
>
> open("/site-cookbooks", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|
>
> O_CLOEXEC) = -1 ENOENT (No such file or directory)
>
>
>
> I don't know why chef-solo is looking for cookbooks in /cookbooks
>
> and /site-cookbooks.
>
> Please note I have no /etc/chef directory.
>
>
>
> Symlinking the cookbooks/site-cookbooks subdirs of my chef repo to /
>
> works.
>
> But that's ugly :)
>
>
>
> Here is the content of my solo.rb file:
>
> $ cat solo.rb
>
> current_dir = File.dirname(__FILE__)
>
>
>
> file_cache_path current_dir
>
> cookbook_path ["#{current_dir}/cookbooks",
>
> "#{current_dir}/site-cookbooks"]
>
> json_attribs "#{current_dir}/solo.json"
>
> role_path "#{current_dir}/roles"
>
>
>
> And my solo.json file:
>
> $ cat solo.json
>
> {
>
> "run_list": [ "recipe[my_cookbook]" ]
>
> }
>
>
>
> And I run chef-solo like this:
>
> $ sudo chef-solo -c solo.rb
>
>
>
> I downloaded and installed rubygems manually, and I'm using the latest
>
> chef gem.
>
>
>
> Any idea ?
>
>
>
>
>
> Le mercredi 20 octobre 2010 à 13:16 +0100, Dreamcat4 a écrit :
>
>> It should be possible to generate the metadata by running a rake task
>
>> (Rakefile in the chef-repo parent folder, a seperate git-repository for
>
>> containing your cookbooks).
>
>>
>
>> Assuming its still there - as havent used it recently.
>
>>
>
>> 2010/10/20 Sébastien Nicouleaud
>
>> <
>:
>
>> > I want to develop cookbooks and test them in virtualbox before using
>
>> > them in production.
>
>> >
>
>> > Having to upload my cookbooks to the chef server and run chef-client
>
>> > from virtualbox everytime I make a little change seems like overkill...
>
>> >
>
>> > So I clone my chef repository in virtualbox, write a solo.rb file to
>
>> > make my cookbooks_path point to the cookbooks dir of my repository, and
>
>> > a solo.json file to make it use my recipe.
>
>> >
>
>> > But when I run chef-solo, it says my cookbook is not found. I suppose
>
>> > it
>
>> > has something to do with the metadata.json file of my cookbook not
>
>> > being
>
>> > generated.
>
>> >
>
>> > So I try to generate the metadata using the knife cookbook metadata
>
>> > subcommand, but knife now complains about the chef server
>
>> > authentication
>
>> > (which I didn't set up since I wanted to use chef-solo).
>
>> >
>
>> > So, my question is: is there a way to develop and test cookbooks
>
>> > locally
>
>> > without any chef server ?
>
>> > Or am I missing something ?
>
>> >
>
>> > Seb
>
>> >
>
>> >
>
>> >
>
>
>
>
>
>
Archive powered by MHonArc 2.6.16.