[chef] Re: Chef-Solo to Chef-Zero


Chronological Thread 
  • From: John Keiser < >
  • To:
  • Subject: [chef] Re: Chef-Solo to Chef-Zero
  • Date: Wed, 3 Sep 2014 08:18:51 -0700

chef-metal has an interesting variant on this ... if your cookbook can be served by a local chef-zero, it will serve up your local repository directory directly, making for a very tight edit > converge > edit > converge loop.  You can replicate the effect with:

Setup:
> cd <your chef repo containing cookbook and such>
> knife serve
> ssh -R 8889:localhost:8889 <remote machine>
> set up /etc/chef/client.rb with "chef_server_url http://localhost:8889"

Debug cycle:
<edit cookbook on your local machine>
> chef-client
<edit cookbook on your local machine>
> chef-client
...

Now anytime you run chef-client on the remote machine, it will immediately pick up the latest cookbook from your local directory without any copying or vendoring or whatnot.

It can't be done directly with berkshelf, but if you berks vendor to your repository directory, you can edit the cookbook there and reflect the changes back when you are done.


On Tue, Sep 2, 2014 at 2:07 PM, Durfee, Bernie (GE Global Research) < " target="_blank"> > wrote:
A common workflow I use is…

  1.  Change my cookbook
  2.  Run ‘berks package’ to build a complete tarball of my cookbook with all dependencies
  3.  SCP to a server
  4.  Run ‘sudo chef-solo -o “recipe[my-fancy-cookbook::default]" -r cookbooks-1409688848.tar.gz’ to test the cookbook
  5.  Repeat

Is this workflow possible with chef-client in local mode? Can I pass chef-client a tarball that was created by the ‘berks package’ command?

Thanks!




Archive powered by MHonArc 2.6.16.

§