# Cookbook version dependency selection on chef server

**URL:** <https://discourse.chef.io/t/cookbook-version-dependency-selection-on-chef-server/5919>\
**Category:** Chef Infra (archive)\
**Created:** [November 11, 2014, 5:03pm UTC](https://discourse.chef.io/t/cookbook-version-dependency-selection-on-chef-server/5919 "2014-11-11T17:03:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Berg](https://avatars.discourse-cdn.com/v4/letter/e/91b2a8/32.png) [@Eric\_Berg](https://discourse.chef.io/u/Eric_Berg)\
**Post date:** [November 11, 2014, 5:03pm UTC](https://discourse.chef.io/t/cookbook-version-dependency-selection-on-chef-server/5919/1 "2014-11-11T17:03:42Z")

</div>

Regarding cookbook dependencies with chef-client, if for example two versions  
of the yum cookbook (versions 2.x and 3.x…incompatible btw) reside on the  
chef server and the metadata.rb file provides no version dependency  
constraints, which cookbook will include\_recipe calls use?

Thanks.

---

<div class="post-metadata">

**Author:** ![ameir](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@ameir](https://discourse.chef.io/u/ameir)\
**Post date:** [November 11, 2014, 5:08pm UTC](https://discourse.chef.io/t/cookbook-version-dependency-selection-on-chef-server/5919/2 "2014-11-11T17:08:08Z")

</div>

I think most people here have probably been bitten by something like this in some form or another.

chef-client will pull down the latest version from the Chef server, even if it’s incompatible. It’s always best to specify, even if it’s optimistic ‘\>=’ or pessimistic ‘~\>’.

-Ameir

-----Original Message-----

From: [eberg@bergbrains.com](mailto:eberg@bergbrains.com)[eberg@bergbrains.com](mailto:eberg@bergbrains.com)  
To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
Sent: Tuesday, November 11, 2014  
Subject: [chef] Cookbook version dependency selection on chef server

Regarding cookbook dependencies with chef-client, if for example two versions  
of the yum cookbook (versions 2.x and 3.x…incompatible btw) reside on the  
chef server and the metadata.rb file provides no version dependency  
constraints, which cookbook will include\_recipe calls use?

Thanks.

---

<div class="post-metadata">

**Author:** ![coderanger](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/coderanger/32/5_2.png) [@coderanger](https://discourse.chef.io/u/coderanger)\
**Post date:** [November 11, 2014, 6:23pm UTC](https://discourse.chef.io/t/cookbook-version-dependency-selection-on-chef-server/5919/3 "2014-11-11T18:23:10Z")

</div>

On Nov 11, 2014, at 9:03 AM, Eric Berg [eberg@bergbrains.com](mailto:eberg@bergbrains.com) wrote:

> Regarding cookbook dependencies with chef-client, if for example two versions  
> of the yum cookbook (versions 2.x and 3.x…incompatible btw) reside on the  
> chef server and the metadata.rb file provides no version dependency  
> constraints, which cookbook will include\_recipe calls use?

You can always use knife-solve to run the version solution and see what you will get.

--Noah
