What is proper way to set attributes in policyfile


#1

Setting attributes in policyfile as follow does not seem to work with ‘node.default’ in the recipe but with ‘node.attributes’.

default['apple']['size']['big']
default['apple']['color']['red']

Should I just use ‘node.attributes’ in recipe instead of ‘node.default’ if I want to use policyfile setting attributes in it? That way, I think I can use cookbooks not writing a wrapper.


#2

To read attributes in a recipe you should only ever use node by itself, ie: node['apple']['size']['big'].
If I’ve not answered your question, then I apologise, but please provide more detail :slight_smile:


#3

That was a perfect answer ever!
Thank you!