For knife, is there a way to do a manual merge?

139 Views Asked by At

For knife, is there a way to do a manual merge using knife cookbook site install?

I ask because I've done some serious hacking against the nagios cookbook to among other things make it work with chef-solo, and running knife cookbook site install -b nagios blows away al my changes.

Is there a way to actually merge my environment-specific changes back into the nagios cookbook in my local repo?

Or do I have to redo all my changes from scratch or be stuck on the old version?

Edit: To be clear, I'm pulling the new cookbook changes from opscode using knife cookbook site install into my local repository. I'm not using knife upload at all. The problem is that the act of pulling down the opscode changes ALSO destroys any additional changes that I've made to the cookbook on my local machine. What I'm wondering is if there's a way to preserve my merges or if I have to go through and manually reset all my changes?

1

There are 1 best solutions below

0
On

As Mark O'Connor already said, knife does not support merging cookbooks. If you would like to use site's cookbook, but need to add some modifications there, it is better to create your new cookbook as a wrapper to the site's.

In your case, you can create a nagios-wrapper cookbook that will call nagios cookbook's recipes, but will also have additional attributes and resources that will overwrite the changes made by nagios cookbook.