Thankyou all guys for your explanations!generally, no. if you want to override an attribute later in the run_list you want to override it in the attributes files. the node attributes which are used for input should be finalized when you're done parsing attributes files. that is the job of the stages in the chef-client converge which prior to recipe code -- assembling the input state of the node object. the recipes should consume that object and shouldn't need to mutate it.
My brain was on holidays that day, when i wrote the question, but in some way your answers bring some light to the issue!
Putting it all together:
- Avoid logic on template as possible.
- Use variables on template resources when you need logic/pre-proccessing. Putting logic on recipe's side.
- If you give node attribute values directly or computed to the template, through variables. Better do it with lazy, so other cookbooks can override those attributes later on the runlist.
Archive powered by MHonArc 2.6.16.