[chef] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: any plan for partial templates in Chef?


Chronological Thread 
  • From: Peter Norton < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: any plan for partial templates in Chef?
  • Date: Thu, 15 Nov 2012 15:28:05 -0500

My feeling is that you'd want a way to make that visible so each layer's owner can DTRT.

-Peter

On Thu, Nov 15, 2012 at 2:17 PM, Daniel DeLeo < " target="_blank"> > wrote:

On Thursday, November 15, 2012 at 10:58 AM, Peter Norton wrote:

So if a user has a working template, then wants a partial that could work with it (and I can see partials being mixed in - am I right about that?) then by using the partial they could break their configuration.  This just gets sticky and it'd be nice to have a namespace that means "the port list supplied to the template always", "the port list supplied to a partial, always" and "what a mashup of the layers turns up, always", and "a way to see what the mashup was made from".

-Peter

But how and why would a user get themselves into this tangled mess? The only thing I can think of is that for some reason you control the partial and the resource declaration but not the top-level template, and the top-level template is overriding some variable you passed in to it. This seems like it's an unlikely scenario, bad design, and easy enough to work around without doing gymnastics to make the state of every layer available to every other layer. For the sake of argument, what happens if you create a partial-within-a-partial-within-a-partial and all of them override each others' variables?

-- 
Daniel DeLeo
 

On Thu, Nov 15, 2012 at 12:21 PM, Daniel DeLeo < " target="_blank"> > wrote:

On Thursday, November 15, 2012 at 9:17 AM, Peter Norton wrote:

If using a partial can cause shadowing then some namespacing should come into play in case e.g. node and node-prime with modified values are both passed in.


-Peter

I'd rather leave this up to the user. For example, if you have a template

template "/path"
  variables :ports => [8000, 8080]
end

And a partial:

render "my_partial", :variables => {:ports => [4000]}

Then I think you specified your intent, and chef should respect it.

-- 
Daniel DeLeo







Archive powered by MHonArc 2.6.16.

§