- Install ChefDK and yum install the rpm https://downloads.chef.io/chefdk#el
- Install Chef Server by downloading from https://downloads.chef.io/chef-server#el
- run as su, chef-server-ctl reconfigure
- install chef-manage by running chef-server-ctl install chef-manage
- run chef-server-ctl reconfigure
- run chef-manage-ctl reconfigure
- Create a folder in your home directory - this will be the workspace to try recipes and cookbooks. let's call it 'learn-chef', switch to this folder and run the following:
sudo yum -y install git # if not installed
git init
git remote add origin https://github.com/patb23/learning-chef-cloud
-
create user, org in chef-server by running sudo chef-server-ctl user-create pattabi Pattabiraman M patxx@gmail.com 'password' --filename pattabi.pem sudo chef-server-ctl org-create dev "Development " --association_user pattabi --filename dev-validator.pem
-
Login to management console. go to administration tab and select 'Generate Knife Config'. this will create the knife.rb file content will be as shown:
# See https://docs.getchef.com/config_rb_knife.html for more information on knife configuration options
current_dir = File.dirname(__FILE__)
log_level :info
log_location STDOUT
node_name "pattabi"
client_key "#{current_dir}/pattabi.pem"
chef_server_url "https://localhost/organizations/dev"
cookbook_path ["#{current_dir}/../cookbooks"]
This file along with the user pem (pattabi.pem) need to moved to a folder (your workspace, let's call it 'learn-chef') under .chef subfolder.
- Now we are armed with the swiss-knife to try recipes and publish cookbooks. Do these 2 additional steps to ensure connectivity with the Chef Server that was configured above.
knife ssl fetch
knife ssl check
If something goes wrong and/or want to remove the previously installed server, following gist is very useful