Find us on facebook

Jun 30, 2015

Setup Chef Server


View Ubuntu version details - cat /etc/lsb-release

chef-solo -v
Install chef - curl -L https://www.opscode.com/chef/install.sh | sudo bash

check version - chef-solo -v

make configuration file 
cd /etc/
sudo mkdir chef
In etc/chef create file solo.rb
sudo vi solo.rb

repo = '/etc/chef/src'

cookbook_path repo + '/cookbooks'
data_bag_path repo + '/data_bags'
role_path repo + '/roles'

log_level :info
log_location STDOUT


Press esc to go to normal mode and :x or :wq to save and exit
sudo mkdir src
go to src
cd src
cat ../solo.rb


sudo mkdir cookbooks data_bags roles
cookbooks - contain bunch of recipes
within cookbooks create directory called common and go inside it
create recipes directory and create sudo vi default.rb
directory '/root' do
 user 'root'
 group 'root'
 mode '0700'
end
Save and exit


Create run list to run the default recipes with command - sudo chef-solo -o 'recipe[common]'
change the mode - sudo chmod 0770 /root
Again run the default recipes with command - sudo chef-solo -o 'recipe[common]'


No comments:

Post a Comment