Wen
Wen

Reputation: 1230

When using chef, In what case one would set attributes in a node itself?

When configuring a node, I think the good practice is to have attributes specified in recipes, roles, or environments, but not in the node itself. Also in Chef's attribute precedence manual, it doesn't even include the case for "attribute located in node". But I noticed that there's this option let you edit attributes of a node in Opscode's Web UI. Does anyone have a scenario that you'd set attributes directly in the node? Thanks.

Opscode screenshot

Upvotes: 1

Views: 52

Answers (1)

coderanger
coderanger

Reputation: 54249

Short answer, don't.

Long answer, it is used sometimes either as part of a self-registration system for service discovery or external storage for idempotence checks (common example being storing a randomly generated DB password as a node attribute).

This is very much a mis-feature of Chef and there are murmurs of trying to fix it in a future major version but nothing concrete yet.

Upvotes: 1

Related Questions