[chef] Re: Including sub templates


Chronological Thread 
  • From: "John E. Vincent (lusis)" < >
  • To:
  • Cc: Paul Choi < >
  • Subject: [chef] Re: Including sub templates
  • Date: Tue, 5 Apr 2011 13:14:22 -0400
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=jH0nKF7pFKVmxi3ySPaSl3ZcBHfPWTLx5sPDxsRisNXWPEFOMfPsIiRT4xWGfwfr2f fVYE8cWS8a/vZLjt0EdfsfeRhNNdeNhIl5KWz5OJnvPEUynX+dFoviE4MEzm0tIsTMHP aAqVwgMtHXxDXkHpXBqcqRXmGSb2YaQzNjuEQ=

This is a limitation of ERB not chef per-se. For instance, in the
puppet world I had to do this:

https://gist.github.com/663131

You may just have to resort to actually including all the
possibilities inside of the ERB as conditional blocks. I've personally
not had need to try the above with Chef yet.

On Tue, Apr 5, 2011 at 1:01 PM, Paul Choi 
< >
 wrote:
> Hello,
> I apologize in advance because I think this has been asked before... But I
> can't seem to find it in the archives.
> How do you include another .erb in a template?
> In my .erb, can I try something like this? (erubis -z syntax check comes out
> ok)
> <% ERuby.import("schema.yaml.erb") %>
> Or is it better to do something like in Ruby On Rails:
> <% render :partial => "schema" %>
> Where it'd reference a file called "_schema.yaml.html.erb"?
> Which would work, and also, which is better?
> -Paul



Archive powered by MHonArc 2.6.16.

§