Chef - priority of attributes set at node level

I might have missed something in the document, but after reading the order of using attributes when it is defined in several places, I don’t understand where the attributes set at the node level enter the equation

At levels 1 to 15, where attributes can be set and overridden, it mentions a recipe, environment, role, attribute file, but it never mentions what happens to attributes defined in node, e.g. knife node edit ...

It looks like you can only define attributes of the normal type on node? Normal attributes are only mentioned for priority levels 7 and 8 in the list ... attribute files and recipes, respectively.

So, if I set the attribute to node, which was also defined at the environment level and the level that wins?

+4
source share
1 answer

- node . node Chef node JSON (-j - -), " node". , . node w/ (node.normal ..), . node ( Chef Server) , , force_default force_override, .

, , - :

  • default['thing'] = 'thang' - cookbook.
  • node.default['thing'] = 'thang' - .
  • "default": { "thing": "thang" } - node JSON
  • default_attributes("thing" => "thang") - ( Ruby DSL ).
  • , environment...

, .:)

; recipe node, Ruby. . - " ", , , , . , Chef.

- - - , node .

, Ruby , , . , " -" node -attrs cookbook.

+7

All Articles