jsonchef-infrachef-attributes

Is chef_type mandatory for a node?


In a project that uses Chef Server, we are using the following concepts:

The environment and role json files looks fine (they have chef_type and json_class):

but the node looks like this (no chef_type, no json_class):

Is it a real Chef node?

And does is satisfy the following precedence?
I supposed that if I had "normal" "key":"value" in node, role and environment, the following precedence (overwriting) order was applied: node > role > environment, but according to that documentation the precedence is role > environment > recipe and the recipe is in the same table cell as node.


Solution

  • We've been slowly fixing the JSON loading code to not rely on the json_class auto-inflation bits. To the best of my knowledge chef_type was never actually used, but it may still be checked for by some of the testing code.

    As for the precedence question: roles and envs can contain attributes at both the default and override levels. Override > normal > default. In general we recommend against the use of the normal level. It's not deprecated but we're moving in that direction (very slowly because we have many years of compat to think about).