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.

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.comeberg@bergbrains.com
To: 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.

On Nov 11, 2014, at 9:03 AM, Eric Berg 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