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


Chronological Thread 
  • From: "John E. Vincent (lusis)" < >
  • To: " " < >
  • Subject: [chef] Re: Re: Customizing the templates of a community cookbook?
  • Date: Sun, 26 May 2013 11:11:26 -0400

This should also serve as a call to folks to make the templates used an attribute where possible/where it makes sense:





On Sun, May 26, 2013 at 8: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.

§