- From: Lamont Granquist <
>
- To:
- Cc: "aL." <
>
- Subject: [chef] Re: [Template] - variables vs direct attribute access
- Date: Fri, 31 Oct 2014 10:15:15 -0700
A whole lot of the pain involved in attribute precedence levels could
be avoided if people would construct a variable in their recipes (or in
a library) that was composed of inputs with whatever precedence their
logic implied, and then pass that plain ruby variable into resources
like templates.
Running the node object through everything can be elegant and simple,
but as soon as you start to fight with attributes and go looking for
force_default, then you should really consider just rubbing some plain
ruby on the problem and also introducing multiple node attributes
rather than trying to make one node attribute do all the work.
On Fri Oct 31 04:49:46 2014, aL. wrote:
Ohai chefs!
I just having a talk with a team member about why or why not use
"variables" with lazy or not on template resources.
I dont know what is the right way or the "bad practice" way of doing
this. Because if you can access attributes directly inside the
template, and attributes are compiled an resolved on compile time.
¿Why are you going to want to use variables params on templates?
Could be that varibles were just another fail point on the chain, right?
Thanks a lot!!!
--
Si necesitas una máquina para hacer algo y no la compras al final te
darás cuenta de que has pagado lo mismo y no tienes la máquina.--Henry
Ford
Alberto
Archive powered by MHonArc 2.6.16.