Chef solo

Install chef
============
> curl -L https://www.opscode.com/chef/install.sh | bash
 
Check
=====
> chef-solo -v
 
Setup chef repository
=====================
> wget http://github.com/opscode/chef-repo/tarball/master
 
> tar zxvf master
 
> mv opscode-chef-repo-f9d4b0c/ chef-repo
 
>ls chef-repo/
 
Create .chef directory inside chef-repo
=======================================
> mkdir chef-repo/.chef
 
Setup a local cookbook path
===========================
 
> vi chef-repo/.chef/knife.rb
cookbook_path [ '/root/chef-repo/cookbooks' ]
 
Create your first cookbook
==========================
 
> knife cookbook create ntp
 
Writing your first recipe
=========================
> vi chef-repo/cookbooks/ntp/recipes/default.rb
 
package 'ntp'
 
Now configure your server using chef-solo
=========================================
> vi chef-repo/solo.rb
 
file_cache_path "/root/chef-solo"
cookbook_path "/root/chef-repo/cookbooks"
 
> vi web.json
 
{
"run_list": [ "recipe[ntp]" ]
}
 
Ensure ntp is not installed
===========================
> yum remove -y ntp
 
Use chef-solo to configure your server
=====================================
 
> chef-solo -c chef-repo/solo.rb -j chef-repo/web.json
 
Confirm ntp is installed
========================
> yum info ntp
 
Rate this item
(0 votes)
Rajesh Kumar

.

Total, Over 12 years of extensive experience in the Software Configuration Management domain having depth knowledge of DevOps, Continuous Integration and Delivery, Configuration Management, Build and Installer, Release Management and Application Management.

More in this category:

What corporate management say about us?

Trainer & the training material were excellent.

Rohit
Infrastructure Admin, India
Sep 02, 2016

Authors

Login