Reputation: 1749
I'm quite a newbie on Chef and I'm trying to do the first steps, so sorry for the simply question and for mistakes..
I've followed the official tutorial so I've concepts quite clear and I've seen how to build a cookbook, how to check using kitchen converge and how to upload it on Chef Server.
Now I'd like to build a simple cookbook that use the tomcat cookbook downloaded from chef supermarket.
I havent'd found a tutorial / examples for this so, you know something that could be useful please give me the link.
What I've tried to do:
test
and I've generated it using chef generate cookbook test
kitchen.yml
file for my target platform that is CentOS 7 so - name: centos-7
kitchen create
and then the command kitchen converge
kitchen
exec .c whoami
tomcat
(ref. https://supermarket.chef.io/cookbooks/tomcat)Berksfile
in this way source 'https://supermarket.chef.io' metadata cookbook 'tomcat'
Then I've modified metadata.rb
adding depends 'tomcat', '~> 3.0.0'
Now, how have I to modify my default.rb
recipe (or other files ...), to obtain a working cookbook?
Upvotes: 0
Views: 583
Reputation: 1525
It is a good practice to run berks install
after change to Berksfile
, it will update Berksfile.lock
. Then, kitchen converge
will transfer all files to the VM. In default.rb
of your cookbook you should use tomcat's cookbook resources as described in the README.md. For example:
tomcat_install 'helloworld' do
version '8.0.36'
end
Upvotes: 1