[chef] Re: [Template] - variables vs direct attribute access


Chronological Thread 
  • From: Lamont Granquist < >
  • To: "aL." < >
  • Cc:
  • Subject: [chef] Re: [Template] - variables vs direct attribute access
  • Date: Sat, 01 Nov 2014 20:05:19 -0700

On 11/1/14, 4:48 PM, aL. wrote:
Thankyou all guys for your explanations!

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.
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.



Archive powered by MHonArc 2.6.16.

§