- From: Alex Kiernan <
>
- To:
- Subject: [chef] Re: Using a template inside a provider
- Date: Wed, 20 Apr 2011 18:42:19 +0100
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=T/DODFJ180vQYS1Z7jyzIu5YOccBBTK4MR2GsEhI6HckBFdOziKG+QILQV+oU1J8ei I+frObXal3SoIBgOo6pfJOLDErqRfMxd+KqnT7vBOzNhxyY633k7wgVpLkxC1S65mXAx yzF8vUZ5IZD/mYPGRBuTO3ewxFN6ITLiBwEJ4=
RTFM :)
Thanks - for whatever reason the penny just didn't drop that was there
for doing just this!
On 4/20/11, Seth Chisamore
<
>
wrote:
>
Alex,
>
Look into the 'cookbook' attribute for the template resource:
>
http://wiki.opscode.com/display/chef/Resources#Resources-Template
>
>
You can then expose this as an attribute on your LWRP. The default would be
>
set to the cookbook your LWRP lives in. Then pass this value (passed in as
>
an LWRP attribute) directly down to the template resource used in your
>
provider making for easy overrides.
>
>
Seth
>
>
--
>
Opscode, Inc.
>
Seth Chisamore, Senior Technical Evangelist
>
IRC, Skype, Twitter, Github: schisamo
>
>
On Wednesday, April 20, 2011 at 7:21 AM, Alex Kiernan wrote:
>
I'm working on a provider for delivering tomcat instances (so separate
>
> CATALINA_BASE/CATALINA_HOME), but I need to deliver customised
>
> versions of some of the standard config files (e.g.
>
> catalina.properties). Trying to use a template inside the provider
>
> works fine, but the recipe consuming the provider then has to know
>
> that it needs that template file inside its template directory.
>
>
>
> Is there some way to package templates alongside the provider? Or
>
> maybe I'm going about this the wrong way... I'll want to be able to
>
> override those file defaults too in different recipes.
>
>
>
> Any thoughts?
>
>
>
> --
>
> Alex Kiernan
>
>
>
>
--
Sent from my mobile device
Alex Kiernan
Archive powered by MHonArc 2.6.16.