Which cookbook version wins in this case?

Say I have a web_role cookbook, and its metadata.rb file looks like this

depends ‘apache’, '= 1.0.0’
depends ‘webapp’, '= 1.0.0’
depends ‘someapp’, ‘= 1.0.0’

…and my webapp cookbook’s metadata.rb files look like…

depends ‘apache’ # Not pinned to any version

On the server I have apache@1.0.0mailto:apache@1.0.0 and apache@1.2.0mailto:apache@1.2.0 versions of the apache cookbook

Now if I add my web_role cookbook to my node’s run list, which version of the apache cookbook will converge, 1.0.0 defined in the web_role’s metadata.rb file, or the 1.2.0, latest version on the chef server?

Chris

1.0.0 should win. It satisfies all requirements, where 1.2.0 does not.

On Mar 10, 2015, at 2:23 PM, Fouts, Chris Chris.Fouts@Sensus.com wrote:

Say I have a web_role cookbook, and its metadata.rb file looks like this

depends ‘apache’, ‘= 1.0.0’
depends ‘webapp’, ‘= 1.0.0’
depends ‘someapp’, ‘= 1.0.0’

…and my webapp cookbook’s metadata.rb files look like…

depends ‘apache’ # Not pinned to any version

On the server I have apache@1.0.0 and apache@1.2.0 versions of the apache cookbook

Now if I add my web_role cookbook to my node’s run list, which version of the apache cookbook will converge, 1.0.0 defined in the web_role’s metadata.rb file, or the 1.2.0, latest version on the chef server?

Chris

Thanks. I’m testing this now. How do I show the cookbooks’ version that converged on the node? “knife node show” of course shows the run list, but not the cookbooks’ versions?

Chris

From: Taylor Price [mailto:tayworm@gmail.com]
Sent: Tuesday, March 10, 2015 10:46 PM
To: chef@lists.opscode.com
Subject: [chef] Re: Which cookbook version wins in this case?

1.0.0 should win. It satisfies all requirements, where 1.2.0 does not.

On Mar 10, 2015, at 2:23 PM, Fouts, Chris <Chris.Fouts@Sensus.commailto:Chris.Fouts@Sensus.com> wrote:
Say I have a web_role cookbook, and its metadata.rb file looks like this

depends ‘apache’, ‘= 1.0.0’
depends ‘webapp’, ‘= 1.0.0’
depends ‘someapp’, ‘= 1.0.0’

…and my webapp cookbook’s metadata.rb files look like…

depends ‘apache’ # Not pinned to any version

On the server I have apache@1.0.0mailto:apache@1.0.0 and apache@1.2.0mailto:apache@1.2.0 versions of the apache cookbook

Now if I add my web_role cookbook to my node’s run list, which version of the apache cookbook will converge, 1.0.0 defined in the web_role’s metadata.rb file, or the 1.2.0, latest version on the chef server?

Chris

You could always examine the cookbook on your node - it should be in chef's
cache directory after convergence. There may be a knife plugin somewhere
that will show you cookbook version resolution based on a node's run list.

On Wed, Mar 11, 2015 at 9:39 AM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

Thanks. I’m testing this now. How do I show the cookbooks’ version that
converged on the node? “knife node show” of course shows the run list, but
not the cookbooks’ versions?

Chris

From: Taylor Price [mailto:tayworm@gmail.com]
Sent: Tuesday, March 10, 2015 10:46 PM
To: chef@lists.opscode.com
Subject: [chef] Re: Which cookbook version wins in this case?

1.0.0 should win. It satisfies all requirements, where 1.2.0 does not.

On Mar 10, 2015, at 2:23 PM, Fouts, Chris Chris.Fouts@Sensus.com wrote:

Say I have a web_role cookbook, and its metadata.rb file looks like this

depends ‘apache’, ‘= 1.0.0’

depends ‘webapp’, ‘= 1.0.0’

depends ‘someapp’, ‘= 1.0.0’

…and my webapp cookbook’s metadata.rb files look like…

depends ‘apache’ # Not pinned to any version

On the server I have apache@1.0.0 and apache@1.2.0 versions of the apache
cookbook

Now if I add my web_role cookbook to my node’s run list, which version of
the apache cookbook will converge, 1.0.0 defined in the web_role’s
metadata.rb file, or the 1.2.0, latest version on the chef server?

Chris

I believe you'll find the versions used at the top of the client log as
well, e.g. "nginx@3.0.1"

--
Michael F. Weinberg | Director of Operations
http://heavywaterops.com | @heavywaterops

On Wed, Mar 11, 2015 at 9:58 AM, tayworm . tayworm@gmail.com wrote:

You could always examine the cookbook on your node - it should be in
chef's cache directory after convergence. There may be a knife plugin
somewhere that will show you cookbook version resolution based on a node's
run list.

On Wed, Mar 11, 2015 at 9:39 AM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

Thanks. I’m testing this now. How do I show the cookbooks’ version that
converged on the node? “knife node show” of course shows the run list, but
not the cookbooks’ versions?

Chris

From: Taylor Price [mailto:tayworm@gmail.com]
Sent: Tuesday, March 10, 2015 10:46 PM
To: chef@lists.opscode.com
Subject: [chef] Re: Which cookbook version wins in this case?

1.0.0 should win. It satisfies all requirements, where 1.2.0 does not.

On Mar 10, 2015, at 2:23 PM, Fouts, Chris Chris.Fouts@Sensus.com wrote:

Say I have a web_role cookbook, and its metadata.rb file looks like this

depends ‘apache’, ‘= 1.0.0’

depends ‘webapp’, ‘= 1.0.0’

depends ‘someapp’, ‘= 1.0.0’

…and my webapp cookbook’s metadata.rb files look like…

depends ‘apache’ # Not pinned to any version

On the server I have apache@1.0.0 and apache@1.2.0 versions of the
apache cookbook

Now if I add my web_role cookbook to my node’s run list, which version of
the apache cookbook will converge, 1.0.0 defined in the web_role’s
metadata.rb file, or the 1.2.0, latest version on the chef server?

Chris

Noah wrote a knife plugin to ask the server what cookbooks it would give you: GitHub - coderanger/knife-solve: A knife plugin to see the Chef Server version solver solution for a given set of cookbooks.

--
Daniel DeLeo

On Wednesday, March 11, 2015 at 10:03 AM, Michael Weinberg wrote:

I believe you'll find the versions used at the top of the client log as well, e.g. "nginx@3.0.1 (mailto:nginx@3.0.1)"

--Michael F. Weinberg | Director of Operations
http://heavywaterops.com | @heavywaterops

On Wed, Mar 11, 2015 at 9:58 AM, tayworm . <tayworm@gmail.com (mailto:tayworm@gmail.com)> wrote:

You could always examine the cookbook on your node - it should be in chef's cache directory after convergence. There may be a knife plugin somewhere that will show you cookbook version resolution based on a node's run list.

On Wed, Mar 11, 2015 at 9:39 AM, Fouts, Chris <Chris.Fouts@sensus.com (mailto:Chris.Fouts@sensus.com)> wrote:

Thanks. I’m testing this now. How do I show the cookbooks’ version that converged on the node? “knife node show” of course shows the run list, but not the cookbooks’ versions?

Chris

From: Taylor Price [mailto:tayworm@gmail.com]
Sent: Tuesday, March 10, 2015 10:46 PM
To: chef@lists.opscode.com (mailto:chef@lists.opscode.com)
Subject: [chef] Re: Which cookbook version wins in this case?

1.0.0 should win. It satisfies all requirements, where 1.2.0 does not.

On Mar 10, 2015, at 2:23 PM, Fouts, Chris <Chris.Fouts@Sensus.com (mailto:Chris.Fouts@Sensus.com)> wrote:

Say I have a web_role cookbook, and its metadata.rb file looks like this

depends ‘apache’, ‘= 1.0.0’
depends ‘webapp’, ‘= 1.0.0’
depends ‘someapp’, ‘= 1.0.0’

…and my webapp cookbook’s metadata.rb files look like…

depends ‘apache’ # Not pinned to any version

On the server I have apache@1.0.0 (mailto:apache@1.0.0) and apache@1.2.0 (mailto:apache@1.2.0) versions of the apache cookbook

Now if I add my web_role cookbook to my node’s run list, which version of the apache cookbook will converge, 1.0.0 defined in the web_role’s metadata.rb file, or the 1.2.0, latest version on the chef server?

Chris

You may use a report handler for this:

An example one with this use case is available on the doc site here:

Le 2015-03-11 17:39, Fouts, Chris a écrit :

Thanks. I'm testing this now. How do I show the cookbooks' version that converged on the node? "knife node show" of course shows the run list, but not the cookbooks' versions?

Chris

FROM: Taylor Price [mailto:tayworm@gmail.com]
SENT: Tuesday, March 10, 2015 10:46 PM
TO: chef@lists.opscode.com
SUBJECT: [chef] Re: Which cookbook version wins in this case?

1.0.0 should win. It satisfies all requirements, where 1.2.0 does not.

On Mar 10, 2015, at 2:23 PM, Fouts, Chris Chris.Fouts@Sensus.com wrote:

Say I have a web_role cookbook, and its metadata.rb file looks like this

depends 'apache', '= 1.0.0'

depends 'webapp', '= 1.0.0'

depends 'someapp', '= 1.0.0'

...and my webapp cookbook's metadata.rb files look like...

depends 'apache' # Not pinned to any version

On the server I have apache@1.0.0 and apache@1.2.0 versions of the apache cookbook

Now if I add my web_role cookbook to my node's run list, which version of the apache cookbook will converge, 1.0.0 defined in the web_role's metadata.rb file, or the 1.2.0, latest version on the chef server?

Chris

I explore that, thanks!

Chris

From: Tensibai [mailto:tensibai@iabis.net]
Sent: Wednesday, March 11, 2015 1:09 PM
To: chef@lists.opscode.com
Subject: [chef] Re: RE: Re: Which cookbook version wins in this case?

You may use a report handler for this:

An example one with this use case is available on the doc site here: http://docs.chef.io/handlers.html#cookbook-versions-rb

Le 2015-03-11 17:39, Fouts, Chris a écrit :
Thanks. I’m testing this now. How do I show the cookbooks’ version that converged on the node? “knife node show” of course shows the run list, but not the cookbooks’ versions?

Chris

From: Taylor Price [mailto:tayworm@gmail.com]
Sent: Tuesday, March 10, 2015 10:46 PM
To: chef@lists.opscode.commailto:chef@lists.opscode.com
Subject: [chef] Re: Which cookbook version wins in this case?

1.0.0 should win. It satisfies all requirements, where 1.2.0 does not.

On Mar 10, 2015, at 2:23 PM, Fouts, Chris <Chris.Fouts@Sensus.commailto:Chris.Fouts@Sensus.com> wrote:
Say I have a web_role cookbook, and its metadata.rb file looks like this

depends ‘apache’, '= 1.0.0’
depends ‘webapp’, '= 1.0.0’
depends ‘someapp’, ‘= 1.0.0’

…and my webapp cookbook’s metadata.rb files look like…

depends ‘apache’ # Not pinned to any version

On the server I have apache@1.0.0mailto:apache@1.0.0 and apache@1.2.0mailto:apache@1.2.0 versions of the apache cookbook

Now if I add my web_role cookbook to my node’s run list, which version of the apache cookbook will converge, 1.0.0 defined in the web_role’s metadata.rb file, or the 1.2.0, latest version on the chef server?

Chris