Reputation: 419
I'm new to using Chef to bootstrap a Node. I have an ubuntu server. In that i wanted to install Jenkins using jenkins cookbook available in supermarket. For that i added the following commands.
$ knife cookbook site download jenkins
and
$ knife cookbook site install jenkins
I want to know how to run those recipes now.
Upvotes: 1
Views: 1403
Reputation: 77961
Normally you would run a chef server containing the cookbooks and "bootstrap" nodes against this server.
It is possible to run chef locally, but you'll need to install the chefdk, which includes berkshelf for cookbook dependency management.
Step 1: Create Berkshelf file
Berkshelf file to specify the cookbooks to be downloaded:
$ cat Berksfile
source "https://supermarket.chef.io"
cookbook "jenkins"
Step 2: Run chef-client in local mode
# Download cookbooks to local "cookbooks" directory
berks vendor cookbooks
# Run chef client in "local mode"
sudo chef-client -z -r "jenkins::master"
Upvotes: 1
Reputation: 573
To run a cookbook locally you need to use chef-solo or chef-zero. Invoke chef-zero with the -z
argument and pass in a run list with the -o
argument.
chef-client -z -o "recipe[jenkins::master]"
You would typically want to wrap a community cookbook in a wrapper cookbook so that you can customize various options.
Upvotes: 1