[chef] How do you extend / customize an existing cookbook?


Chronological Thread 
  • From: John Wong < >
  • To:
  • Subject: [chef] How do you extend / customize an existing cookbook?
  • Date: Thu, 2 Aug 2012 00:57:12 -0400

Hey guys,

The wiki was very vague about how to do it.
Right now I have my custom configuration files. The Nginx cookbook defines the templates for these configuration files, so by default they are installed.

1. Do I just put my nginx.conf inside files/ directory?
2, Do I edit the template files directly when I need to? Does this prevent me from getting update from the community? I suppose I will merge the changes?

3. I need the directory  /etc/nginx/sites-enabled contains my custom conf file. How do I tell the cookbook or chef to use files/custom.conf?  Where do I put it?

4. I am so new to chef cookbook. I only knew how to I specify default_attributes or override_attributes in my role files.

5. If I add new template or definitions, or new files, doesn't it mean I am writing my cookbook, rather than using the community's one?

I am so unclear how to do these things. Please guide me. Thanks.

John



Archive powered by MHonArc 2.6.16.

§