# Cookbook version

**URL:** <https://discourse.chef.io/t/cookbook-version/1514>\
**Category:** Chef Infra (archive)\
**Created:** [August 4, 2010, 10:02am UTC](https://discourse.chef.io/t/cookbook-version/1514 "2010-08-04T10:02:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Le\_Huy](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@Le\_Huy](https://discourse.chef.io/u/Le_Huy)\
**Post date:** [August 4, 2010, 10:02am UTC](https://discourse.chef.io/t/cookbook-version/1514/1 "2010-08-04T10:02:01Z")

</div>

hi

can someone explain me how cookbook version work ? does it mean that I can have  
multi version of one cookbook and specify in run\_list which version will be  
used ?

---

<div class="post-metadata">

**Author:** ![Thom\_May](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/thom_may/32/130_2.png) [@Thom\_May](https://discourse.chef.io/u/Thom_May)\
**Post date:** [August 4, 2010, 11:05am UTC](https://discourse.chef.io/t/cookbook-version/1514/2 "2010-08-04T11:05:55Z")

</div>

On Wed, Aug 4, 2010 at 11:02, [le.huy@ingdirect.es](mailto:le.huy@ingdirect.es) wrote:

> hi
> 
> can someone explain me how cookbook version work ? does it mean that I can have  
> multi version of one cookbook and specify in run\_list which version will be  
> used ?

That's how it will work, yes. The code is scheduled to land in 0.10  
AIUI; you can have and store multiple versions of cookbooks right now,  
but there's no way to select which one to use - you'll always get the  
latest one.  
-t

---

<div class="post-metadata">

**Author:** ![Le\_Huy](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@Le\_Huy](https://discourse.chef.io/u/Le_Huy)\
**Post date:** [August 5, 2010, 8:18am UTC](https://discourse.chef.io/t/cookbook-version/1514/3 "2010-08-05T08:18:43Z")

</div>

Hi

I am interested in the most appropriate way to change an existing cookbook,  
Assuming that a cookbook must be run in testing environment for a while before putting them into production,  
how we organize these roles and run\_list so we can make that kind of change safely with less pain ?

-----Mensaje original-----  
De: Thom May [[mailto:thom@clearairturbulence.org](mailto:thom@clearairturbulence.org)]  
Enviado el: miércoles, 04 de agosto de 2010 13:06  
Para: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
Asunto: [chef] Re: cookbook version

On Wed, Aug 4, 2010 at 11:02, [le.huy@ingdirect.es](mailto:le.huy@ingdirect.es) wrote:

> hi
> 
> can someone explain me how cookbook version work ? does it mean that I  
> can have multi version of one cookbook and specify in run\_list which  
> version will be used ?

## That's how it will work, yes. The code is scheduled to land in 0.10 AIUI; you can have and store multiple versions of cookbooks right now, but there's no way to select which one to use - you'll always get the latest one. -t

## ATTENTION: The information in this electronic mail message is private and confidential, and only intended for the addresses. Should you receive this message by mistake, you are hereby notified that any disclosure, reproduction, distribution or use of this message is strictly prohibited. Please inform the sender by reply transmission and delete the message without copying or opening it.

---

<div class="post-metadata">

**Author:** ![Gilles\_Devaux](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/gilles_devaux/32/744_2.png) [@Gilles\_Devaux](https://discourse.chef.io/u/Gilles_Devaux)\
**Post date:** [August 11, 2010, 6:03pm UTC](https://discourse.chef.io/t/cookbook-version/1514/4 "2010-08-11T18:03:20Z")

</div>

Is there a document on how cookbook merges are handled with versions?

I migrated to chef 0.9 recently and with 0.8 I relied on cookbook  
merges between /cookbooks and /site-cookbooks. I used it to still use  
nginx::source but with [:nginx][:configure\_flags] \<\<  
"--with-http\_stub\_status\_module" by default. My site-cookbooks/nginx  
just contained an attribute file.

Turns out that if I version my cookbooks with the same version as the  
one in ./cookbooks but this make things difficult to maintain when  
updating the base cookbooks.

Is there a way to handle this nicely or should I completely revise my  
strategy in order to use the common opscode/chef repo and modify the  
minimum to suite my needs?

Thanks

--Gilles

On Wed, Aug 4, 2010 at 4:05 AM, Thom May [thom@clearairturbulence.org](mailto:thom@clearairturbulence.org) wrote:

> On Wed, Aug 4, 2010 at 11:02, [le.huy@ingdirect.es](mailto:le.huy@ingdirect.es) wrote:
> 
> > hi
> > 
> > can someone explain me how cookbook version work ? does it mean that I can have  
> > multi version of one cookbook and specify in run\_list which version will be  
> > used ?
> 
> That's how it will work, yes. The code is scheduled to land in 0.10  
> AIUI; you can have and store multiple versions of cookbooks right now,  
> but there's no way to select which one to use - you'll always get the  
> latest one.  
> -t

---

<div class="post-metadata">

**Author:** ![ringods](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/ringods/32/154_2.png) [@ringods](https://discourse.chef.io/u/ringods)\
**Post date:** [August 16, 2010, 9:26am UTC](https://discourse.chef.io/t/cookbook-version/1514/5 "2010-08-16T09:26:47Z")

</div>

Thom,

On 4 August 2010 13:05, Thom May [thom@clearairturbulence.org](mailto:thom@clearairturbulence.org) wrote:

> That's how it will work, yes. The code is scheduled to land in 0.10  
> AIUI; you can have and store multiple versions of cookbooks right now,  
> but there's no way to select which one to use - you'll always get the  
> latest one.

What does Chef server (in 0.9.x) consider to be the latest? I have a  
suspicion that the server compares version numbers string wise instead  
of numerically. I had two versions of the java cookbook on my server  
(0.9.0 and 0.10.0), both coming from [cookbooks.opscode.com](http://cookbooks.opscode.com). When  
running the java cookbook, the client always gets the 0.9.0 version. I  
had to remove the 0.9.0 version first before the 0.10.0 version gets  
picked up.

Ringo
