[chef] Re: Re: Customizing the templates of a community cookbook?


Chronological Thread 
  • From: Morgan Blackthorne < >
  • To: " " < >
  • Subject: [chef] Re: Re: Customizing the templates of a community cookbook?
  • Date: Sun, 26 May 2013 05:53:43 -0700

Actually, that's exactly what I was looking for-- thanks! His OpenVPN example is dead-on for what I need to do for nagios::server.

*adds Joshua's blog to their Feedly list, after the Nth time of finding something useful on it :)*

--
~*~ StormeRider ~*~

"Every world needs its heroes [...] They inspire us to be better than we are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... http://bit.ly/Ps3uSS


On Sun, May 26, 2013 at 5:40 AM, Zac Stevens < " target="_blank"> > wrote:
On Sun, May 26, 2013 at 1:24 PM, Morgan Blackthorne < " target="_blank"> > wrote:
What's the "right" way to handle this? I'm looking to migrate over to using Berkshelf and something that I'm coming across is that I've got a package or two where I've customized the templates generated by a community cookbook for my specific use (either via OS or host directories).

Is it better to create a wrapper cookbook, or is there some other way to handle this that I'm missing? I found a previous thread on this here: http://lists.opscode.com/sympa/arc/chef/2012-07/msg00038.html, but it looks like whatever scenario they were referencing is no longer in the documentation. (Not sure if it didn't last from the wiki -> doc conversion, or if it had been removed from the wiki prior to that.)

I was able to load the old page using the wayback machine ( http://web.archive.org/web/20120624062311/http://wiki.opscode.com/display/chef/Templates ), but it isn't too helpful in this case.

You'll need a wrapper cookbook which contains your local template, with a recipe that re-opens the resource in the original cookbook and changes its "cookbook" parameter to point to your wrapper cookbook.  Joshua Timberman has a blog post describing this, though his example is changing service resources:


If you'd prefer a little sugar, the chef-rewind gem offers your exact use case as an example: https://github.com/bryanwb/chef-rewind

Hope that helps,


Zac





Archive powered by MHonArc 2.6.16.

§