- From: Mike <
>
- To:
- Subject: [chef] Re: Re: including erubis fragments within a template
- Date: Thu, 28 Jun 2012 10:12:04 -0400
Ah - I think I like that approach better - it's very similar to the
/something.d/ method of inclusion - include something it it is there.
Bryan, thoughts?
On Thu, Jun 28, 2012 at 9:29 AM, Michael Della Bitta
<
>
wrote:
>
Not a universal fix, but could you possibly do it at a higher level with
>
<xml:include> statements?
>
>
Michael
>
>
On Jun 28, 2012 8:32 AM, "Bryan Berry"
>
<
>
>
wrote:
>
>
>
> Dear Chefs,
>
>
>
> I work on almost basis with the Enterprise Java container known as JBoss
>
> AS 7. JBoss's main configuration file, standalone-full.xml, is a whopping
>
> 553 lines long. While it is very long, it actually quite cleanly
>
> structured,
>
> especially when compared to something like sendmail.cf
>
>
>
> Templating such a large file is a mega PITA. JBoss AS 7 is nicely
>
> componentized so that you can easily turn on and off modules. This process
>
> would be a billion times easier and more readable if I could include
>
> fragments within and erubis template like this:
>
>
>
> <?xml version='1.0' encoding='UTF-8'?>
>
>
>
> <server xmlns="urn:jboss:domain:1.2">
>
> <extensions>
>
> <% if @infinispan -%>
>
> <extension module="org.jboss.as.clustering.infinispan"/>
>
> <% end -%>
>
> <extension module="org.jboss.as.web"/>
>
> <% if @webservices -%>
>
> <extension module="org.jboss.as.webservices"/>
>
> <% end -%>
>
> <extension module="org.jboss.as.weld"/>
>
> </extensions>
>
> <% if @infinispan
>
> include_template "infinispan.xml.erb"
>
> end -%>
>
> <% if @webservices
>
> include_template "webservices.xml.erb"
>
> end -%>
>
> <socket-binding-group name="standard-sockets" >
>
> ......
>
> </socket-binding-group>
>
> </server>
>
>
>
> As you can see, this is far more readable than adding complex logic to
>
> already large file
>
>
>
> Is this at all feasible currently in Chef? It would make life a lot easier
>
> for me
- [chef] including erubis fragments within a template, Bryan Berry, 06/28/2012
- [chef] Re: including erubis fragments within a template, Mike, 06/28/2012
- [chef] Re: including erubis fragments within a template, Michael Della Bitta, 06/28/2012
- [chef] Re: Re: including erubis fragments within a template, Mike, 06/28/2012
- [chef] RE: including erubis fragments within a template, Todd H. Foster, 06/28/2012
- [chef] Re: including erubis fragments within a template, John Dyer, 06/28/2012
Archive powered by MHonArc 2.6.16.