[chef] Re: Best practices for modifying standard cookbooks


Chronological Thread 
  • From: AJ Christensen < >
  • To:
  • Subject: [chef] Re: Best practices for modifying standard cookbooks
  • Date: Sat, 24 Nov 2012 09:53:32 +1300

You can re-open resources during compile phase. Bryan W. Berry has released a gem that adds some syntactic sugar to the Recipe [0]

```
thing_to_edit = resources(:template => "name_of_template")
thing_to_edit.cookbook_name "another_cookbook"
thing_to_edit.variables thing_to_edit.variables.merge(:another_param => "some val")
```

Cheers,

AJ



On 24 November 2012 09:47, Leo Dirac (SR) < " target="_blank"> > wrote:
I'm getting ready to update to the new version of the application cookbook, and I'm seeking advice for carrying forwards a custom modification I made.

My issue comes from the application cookbook always doing a "shallow clone" of a git repo (source), which on my systems sometimes causes a failure to deploy.  Last time I fixed this by just changing that line of code from "true" to "false" in my local cookbook.  It's expedient, but doesn't seem like a best practice, and forces me to re-do this kind of change every time I upgrade.

How do others manage customizations to shared cookbooks?

Thanks!





Archive powered by MHonArc 2.6.16.

§