Any plan for partial templates in Chef?

My colleague raised another interesting points:

  • do we want to propagate all variables from the template resource down to
    every partial?
    My guess is yes—I can’t really imagine a use case where you want to hide
    some from a partial. Overwrite it with a different value yes, but not block
    it. Right?

  • I have never tried, but I assume it’s possible to assign a value to these
    variables in a template.
    We need to ensure that setting a variable in a partial does not propagate
    up the chain.
    In other words, I need to #dup the context before sending it to a partial.

On Wed, Nov 14, 2012 at 11:54 PM, Andrea Campi <andrea.campi@zephirworks.com

wrote:

My colleague raised another interesting points:

  • do we want to propagate all variables from the template resource down to
    every partial?
    My guess is yes—I can't really imagine a use case where you want to hide
    some from a partial. Overwrite it with a different value yes, but not block
    it. Right?

  • I have never tried, but I assume it's possible to assign a value to
    these variables in a template.
    We need to ensure that setting a variable in a partial does not
    propagate up the chain.
    In other words, I need to #dup the context before sending it to a partial.

big yes on both points for me!