shawndreck
shawndreck

Reputation: 2069

Remove obviously unwanted cookbooks in chef

I have started using chef but a lot of the times I am going to use it on a CentOs VPS. This means that community cookbooks such windows,iis are of no need to me now and in the foreseeable. I want to be able to customize cookbooks that depend on these cookbooks and its recipes. Is that possible? And if so can you outline the process?

I understand that these cookbooks are meant to be reusable but I wish to customize my chef-repo for a versy specific need.

Hope there is an easy solution out there! Thanks

Upvotes: 0

Views: 245

Answers (1)

Konzulic
Konzulic

Reputation: 1763

Of course you can customize it. Just delete those unneeded ones, and write new ones when existing doesn't fit your needs.

Note: What you must have in your cookbooks directory are:

  • cookbooks you call in your rolls (or Vagrantfile, if you use vagrant), and
  • cookbooks previously mentioned ones depends on.

Now, how to find out what are dependencies:

  • metadata.rb file within each cookbook contains dependencies section.
  • recipes are included by invocation via "include_recipe". Sometimes metadata are not up to date so you'll have to track it this way.

If OpsCode cookbook doesn't suite your needs (even after changing the attributes), search the github for other sources. There's entire ecosystem around this. If none of this turns out to work write your own cookbooks. Use "knife" tool to create an empty cookbook (template). Command would be:

knife cookbook create COOKBOOK_NAME [--cookbook-path PATH_TO_YOUR_COOKBOOK_DYRECTORY]

Besides, rely on the opscode manuals. There's plenty of stuff there ;)

Upvotes: 1

Related Questions