[chef] Re: Re: Re: Re: Re: changing the token delimiters inside the templates


Chronological Thread 
  • From: Akzhan Abdulin < >
  • To: " " < >
  • Subject: [chef] Re: Re: Re: Re: Re: changing the token delimiters inside the templates
  • Date: Sun, 23 Dec 2012 14:09:58 +0400

It's easy. Simply create your own resource like bundled Chef template.

Implementation may be copied from Chef's template. It can be placed ever in cookbook.


2012/12/22 Jeremy Voorhis < " target="_blank"> >
Can Chef use the tilt library for handling templates, or does it exclusively use ERB?

Jeremy


On Fri, Dec 21, 2012 at 2:11 PM, Maven User < " target="_blank"> > wrote:
NVM - I'm going to make maven understand erb syntax instead (for one module).

http://maven.apache.org/plugins/maven-resources-plugin/copy-resources-mojo.html

<delimiters>
  <delimiter>${*}</delimiter>
  <delimiter>@</delimiter>
</delimiters>

(I think :-)



On Fri, Dec 21, 2012 at 5:10 PM, Maven User < " target="_blank"> > wrote:
Yeah, I'd REALLY like to teach chef how to use ${}'s instead of <%>'s

Daniel - thank you!


On Fri, Dec 21, 2012 at 4:09 PM, Daniel DeLeo < " target="_blank"> > wrote:

On Friday, December 21, 2012 at 12:53 PM, Vladimir Girnet wrote:

Chef is using standard Ruby ERB for templates - http://ruby-doc.org/stdlib-1.8.7/libdoc/erb/rdoc/ERB.html


On Dec 21, 2012, at 10:41 PM, Maven User wrote:

Hi all -

Is there a way to change the token delimiters chef uses inside the templates to some other format?

Just curious - this would make my life 300% easier if this were true...


Chef actually uses erubis which is mostly compatible but has some extra features:

If you're looking to, say, include a literal `<%` in your output, according to the docs this can be done with `<%%`.

The docs also explain how to change the "embedding pattern" but chef doesn't expose any way to change it:


-- 
Daniel DeLeo








Archive powered by MHonArc 2.6.16.

§