3

I am trying to setup Munin using Chef, and I'm not sure where to put the customizations that are needed. For example, the documentation on Github says to add munin_plugin 'plugin_name', in the client.rb.

While this is fine for right now, it seems to inhibit my ability to download upstream changes from the cookbook, because I'd have to merge or re-write my changes.

What is the correct way of making customizations to a cookbook?

Do I

  • Modify foo/recipe/default.rb (or similar file, like client.rb here)
  • Create a second cookbook, say munin-custom and create a second custom recipe
  • Create a single personalization cookbook, cookbooks/acme_co to put these changes in?

2 Answers 2

2

The latest trend is to use wrapper cookbooks: http://www.getchef.com/blog/2013/12/03/doing-wrapper-cookbooks-right/ (in case you can't configure that through attributes).

Besides adding additional resources, you can also access resources defined in the upstream cookbook and modify them according to your needs. In case your modifications are only smaller ones, this avoids forking (which I find makes it harder to follow upstream changes than using librarian-chef or Berkshelf with the upstream cookbook).

1

Depends on what you mean by customizations.

Implementation-specific modifications go in the attributes section of the cookbook directory structure.

If you're needing to modify the recipes, I'd just fork a branch of the existing cookbook and keep a Development Chef install around to test out merges for changes.

2
  • Yes it's the "modify recipe" case. So you're saying I should go with the first option and just deal with merge conflicts later?
    – Cody
    Jan 9, 2014 at 16:49
  • Mostly Yes. But don't do that directly in Production. Best to keep a Dev Chef environment around for testing things on a separate network/VLAN. Your case may be different, but unless there was a major problem or a major upgrade I've rarely needed to go back and merge my cookbooks from upstream.
    – Magellan
    Jan 9, 2014 at 16:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .