The attributes files are just rb, so logic could be put in there.
However, as a best practice, I generally do little/no logic in the attributes files, treating them more as strict data. I would generate derived node attributes (using node.set/node.save as in above ruby_block) in recipes.
The reason for this is if I override an attribute in a wrapper cookbook, then I don't want to have to put the logic in the wrapper cookbook, just override an attribute and have the base (wrapped) cookbook do the logic using the overridden attribute.
Archive powered by MHonArc 2.6.16.