0

I am a new to chef cookbooks and currently working on a task. I have already completed the tutorial on chef.io but i am struggling to understand how can i install a cookbook provided at chef-io.

So as of now, I have downloaded the cookbook. Its .tar file and i extracted it. I can see respective default.rb and other files but i am unable to get that how can i add this cookbook to my existing cookbooks which are creating a vm image.

Is there any guide or tutorial that i can follow ?

Em Ae
  • 8,167
  • 27
  • 95
  • 162

3 Answers3

0

If I'm understanding your question correctly, then what you need to do is create a Chef role, and then list all of the recipes that you want to execute in your role's run_list. As for documentation, check out Chef's documentation on roles: Chef Roles

Josh Edwards
  • 888
  • 5
  • 13
0

In addition to Josh's answer it sounds to me like want to add it to your chef-repo after downloading it and extracting the gzip file?

Just add the maven directory to your cookbooks directory. Or you could just do knife cookbook site install maven from within your chef-repo directory.

Or maybe you want to upload it to your Chef Server?

knife cookbook upload maven See: https://docs.chef.io/knife_cookbook.html#upload

Grug
  • 1,870
  • 5
  • 25
  • 38
0

Firstly if i get your question right, you are trying to download an already existing cookbook from the community. If so, you can follow these steps :

1) Download the cookbook which is in the .tar format as you specified, extract it and place that particular cookbook within your chef-repo path from where you want to upload it.

2) Once done, do a "knife cookbook upload cookbook-name"

Now the main part is, if you are trying to upload this cookbook and make it part of your already existing run-list. You need to add this within the run-list.

Else if you are doing it via role, you will need to add this cookbook recipe within your role's run-list.

But keep in mind, whatever cookbook's you download from the community might have dependencies on other cookbook's so choose wisely. The lesser cookbook's the better as this makes your run-list converge faster for a faster chef-client run.

Hope this helps.

Regards, Akshay