Chef version - is there a priority order?

As I understand it, you can install the cookbook version in a file metadata.rb.

You can subsequently reference this version in three places. Other metadata for the cookbook, medium, or run_lists.

What happens if you specify a version restriction for the same cookbook in more than one of these places with different version numbers. Which version is used?

The reason for the request is that the role is not versioned as a cookbook ... and perhaps the production environment is configured to block versions of well-known good cookbooks, but the administrator comes and updates the recipe in Roles run_list, such as apache @ 1.2.2, so that it is different from the limitations of the environment that wins.

Hope this makes sense.

Flo

0
source share
2 answers

The chef's dependency resolver (unfortunately, silently) uses the best version of the dependent cookbook, she can decide the schedule. Which means you have:

  • cookbook runit exists on Chef server versions 0.13.2 and 1.2.0
  • cookbook myface depends on runit without version restriction operator
  • cookbook yourface depends on runit with ~> 0.13.0

When the extended launch list node contains recipe[myface]and recipe[yourface], it will use runit version 0.13.2.

, HTTP 412, . , runit = 1.2.0 recipe[myface] recipe[yourface] , , yourface v0.13.2.

:

  • cookbook couchdb 1.1.0 1.0.0
  • cookbook couchdb 1.1.0 runit ~ > 1.1
  • cookbook couchdb 2.0.0 runit >= 1.0.0 ( bump , )
  • cookbook myface couchdb >= 1.1.0 ( runit 1.2.0)
  • cookbook yourface couchdb ~ > 2.0.0 ( runit 1.0.0)

node recipe[myface], recipe[yourface], , , :

  • couchdb 2.0.0 (- , myface 1.1.0)
  • runit 1.1 (- couchdb 2.0.0)

, , , , - - runit. , , .

, . ( ) . ( ~ > ), , . , . , , .

, / , cookbook =. , (Chef, ) , Hosted Chef (Chef Server SaaS).

+3

, , , . - , , .

, cookbook B > v3.0 X, cookbook B > 1.0. , , "", , - , , .

, :

  • Cookbook .

?

  • , , run-list -...
  • - , , .
+1

All Articles