# Chef-Solo to Chef-Zero

**URL:** <https://discourse.chef.io/t/chef-solo-to-chef-zero/5710>\
**Category:** Chef Infra (archive)\
**Created:** [September 2, 2014, 9:07pm UTC](https://discourse.chef.io/t/chef-solo-to-chef-zero/5710 "2014-09-02T21:07:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Durfee\_Bernie\_GE\_Glo](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/durfee_bernie_ge_glo/32/97_2.png) [@Durfee\_Bernie\_GE\_Glo](https://discourse.chef.io/u/Durfee_Bernie_GE_Glo)\
**Post date:** [September 2, 2014, 9:07pm UTC](https://discourse.chef.io/t/chef-solo-to-chef-zero/5710/1 "2014-09-02T21:07:07Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [September 2, 2014, 9:12pm UTC](https://discourse.chef.io/t/chef-solo-to-chef-zero/5710/2 "2014-09-02T21:12:16Z")

</div>

On Tuesday, September 2, 2014 at 2:07 PM, Durfee, Bernie (GE Global Research) 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!

You’d probably use `berks vendor` to get your cookbook set into a directory and rsync that over instead of shipping a tar archive. You’d have the same basic flow, slightly different commands.

--  
Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![Mathias\_Lafeldt](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@Mathias\_Lafeldt](https://discourse.chef.io/u/Mathias_Lafeldt)\
**Post date:** [September 2, 2014, 9:15pm UTC](https://discourse.chef.io/t/chef-solo-to-chef-zero/5710/3 "2014-09-02T21:15:53Z")

</div>

That's exactly the workflow chef-runner was made for:

> **[GitHub - mlafeldt/chef-runner: The fastest way to run Chef cookbooks](https://github.com/mlafeldt/chef-runner)**
>
> The fastest way to run Chef cookbooks. Contribute to mlafeldt/chef-runner development by creating an account on GitHub.

The tools prepares all cookbooks locally using e.g. Berkshelf, uploads  
them to the server via rsync (very fast), and finally runs Chef Solo.

-Mathias

On Tue, Sep 2, 2014 at 11:12 PM, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:

> On Tuesday, September 2, 2014 at 2:07 PM, Durfee, Bernie (GE Global Research) 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!
> 
> You’d probably use `berks vendor` to get your cookbook set into a directory and rsync that over instead of shipping a tar archive. You’d have the same basic flow, slightly different commands.
> 
> --  
> Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![Durfee\_Bernie\_GE\_Glo](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/durfee_bernie_ge_glo/32/97_2.png) [@Durfee\_Bernie\_GE\_Glo](https://discourse.chef.io/u/Durfee_Bernie_GE_Glo)\
**Post date:** [September 2, 2014, 9:52pm UTC](https://discourse.chef.io/t/chef-solo-to-chef-zero/5710/4 "2014-09-02T21:52:52Z")

</div>

Thanks Mathias!

I like this and am going to use it. But from what I understand chef-solo  
is going to be replaced at some point by chef-client running in local mode.

Are there plans to get chef-runner working with chef-client local mode?

Bernie

On 9/2/14, 5:15 PM, "Mathias Lafeldt" [mathias.lafeldt@gmail.com](mailto:mathias.lafeldt@gmail.com) wrote:

> That's exactly the workflow chef-runner was made for:
> 
> [GitHub - mlafeldt/chef-runner: The fastest way to run Chef cookbooks](https://github.com/mlafeldt/chef-runner)
> 
> The tools prepares all cookbooks locally using e.g. Berkshelf, uploads  
> them to the server via rsync (very fast), and finally runs Chef Solo.
> 
> -Mathias
> 
> On Tue, Sep 2, 2014 at 11:12 PM, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:
> 
> > On Tuesday, September 2, 2014 at 2:07 PM, Durfee, Bernie (GE Global  
> > Research) 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!
> > 
> > You¹d probably use `berks vendor` to get your cookbook set into a  
> > directory and rsync that over instead of shipping a tar archive. You¹d  
> > have the same basic flow, slightly different commands.
> > 
> > --  
> > Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![Durfee\_Bernie\_GE\_Glo](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/durfee_bernie_ge_glo/32/97_2.png) [@Durfee\_Bernie\_GE\_Glo](https://discourse.chef.io/u/Durfee_Bernie_GE_Glo)\
**Post date:** [September 2, 2014, 9:53pm UTC](https://discourse.chef.io/t/chef-solo-to-chef-zero/5710/5 "2014-09-02T21:53:58Z")

</div>

Thanks Daniel, I¹ll give it a try.

Bernie

On 9/2/14, 5:12 PM, "Daniel DeLeo" [dan@kallistec.com](mailto:dan@kallistec.com) wrote:

> On Tuesday, September 2, 2014 at 2:07 PM, Durfee, Bernie (GE Global  
> Research) 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!
> 
> You¹d probably use `berks vendor` to get your cookbook set into a  
> directory and rsync that over instead of shipping a tar archive. You¹d  
> have the same basic flow, slightly different commands.
> 
> --  
> Daniel DeLeo

---

<div class="post-metadata">

**Author:** ![Mathias\_Lafeldt](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@Mathias\_Lafeldt](https://discourse.chef.io/u/Mathias_Lafeldt)\
**Post date:** [September 3, 2014, 9:18am UTC](https://discourse.chef.io/t/chef-solo-to-chef-zero/5710/6 "2014-09-03T09:18:19Z")

</div>

On Tue, Sep 2, 2014 at 11:52 PM, Durfee, Bernie (GE Global Research)  
[bernie.durfee@ge.com](mailto:bernie.durfee@ge.com) wrote:

> Thanks Mathias!
> 
> I like this and am going to use it. But from what I understand chef-solo  
> is going to be replaced at some point by chef-client running in local mode.
> 
> Are there plans to get chef-runner working with chef-client local mode?
> 
> Bernie

Absolutely. In fact, it's already on my list of planned features. I  
specifically designed chef-runner's code base to support multiple  
provisioners. I guess I'm going to make chef-client local mode  
optional when I come around to implementing it, and later make it the  
new default, replacing chef-solo.

If you experience any problems or have ideas for improvements, feel  
free to open a ticket at

> **[Issues · mlafeldt/chef-runner](https://github.com/mlafeldt/chef-runner/issues)**
>
> The fastest way to run Chef cookbooks. Contribute to mlafeldt/chef-runner development by creating an account on GitHub.

-Mathias

---

<div class="post-metadata">

**Author:** ![John\_Keiser1](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/john_keiser1/32/202_2.png) [@John\_Keiser1](https://discourse.chef.io/u/John_Keiser1)\
**Post date:** [September 3, 2014, 3:18pm UTC](https://discourse.chef.io/t/chef-solo-to-chef-zero/5710/7 "2014-09-03T15:18:51Z")

</div>

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   
> knife serve  
> ssh -R 8889:localhost:8889   
> set up /etc/chef/client.rb with "chef\_server\_url [http://localhost:8889](http://localhost:8889)"

Debug cycle:

> chef-client  
>   
> 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) \<  
[bernie.durfee@ge.com](mailto:bernie.durfee@ge.com)\> 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!
