Chef

what is chef ?
Before that we need to know what is configuration management?
Chef is a configuration management tool for software industry/IT.
Actually there are a wide variety of definitions for the term configuration management.

Configuration management covers the set of actions taken by engineering teams for managing the entities like Hardware,Software, Infrastructure involved in delivering a software applications/product used by customers/end users.

Few IT configuration management tools are CFEngine, Puppet, the Desired State Configuration engine in Microsoft Windows, Ansible, SaltStack, and of course, Chef.

Configuring the chef environment i.e server , workstation and client(node).
— Chef server on machine A
download the chef server package
https://downloads.chef.io/chef-server/
– install command
rpm -ivh chef-erverpackage name
– reconfigure
chef-server-clt reconfigure
– verify
chef-server-clt status
you will see following process with pid’s
bookshelf, expander,solr,erchef,nginx,postgresql,rabitting…

—chef workstation on machine B
download the chef workstation package
https://downloads.chef.io/chef-dk/
– install command
rpm -ivh chef-erverpackage name
– now create a new dir
mkdir .chef (its a hidden dir “.chef”)
– from your chef server (machine A) scp the files to .chef dir of machine B
on hef server (machine A) go to /etc/chef-server dir
when you do a ls -ltr , you can see .pem and few more files
scp -p admin.pem root@machineB(IPADDRESS):/root/.chef
the above command copies the file admin.pem from machineA to /root/.chef dir of machine B
similarl copy validator.pem,webui.pem file to /root/.chef dir of machine B

– install knife
knife configure -i
this will ak for a chef user ( provide user name that existing on machine A0
then admin as admin
private key details /root/.chef/
repo as blank

– if ou happen to see any ssl eror
run knife ssl fetch
knife ssl check

– you can see the following once ssl is installed successfully
cd /root/.chef/knife.rb ( rb is rub extension)
verify
knife client list
knife user list

Configuring client/node
downloadn the client/node package
https://downloads.chef.io/chef-client/
– install
rpm -ivh client package name
– make a dir
mkdir /etc/chef ( not a hidden dir)
copy validator.pem file from server to node
rom your chef server (machine A) scp the files to .chef dir of machine B
on hef server (machine A) go to /etc/chef-server dir
when you do a ls -ltr , you can see .pem and few more files
scp -p validator.pem root@machineC(IPADDRESS):/root/chef
– fetch ssl from server
knife ssl fetch -s https://cheserver.example.com
– now go to chef dir /root/chef and you will find trutedcerts in it
verify ssl
knife ssl check -s https://cheserver.example.com

completes all installs

– on all machines , in /etc/hosts file add the ip address of chef server, ip address of chef workstation and chef client
test connection to all mahines using ping .

if there is a connectivity issue , then flush the iptables
iptables – F
iptables-save
service iptables restart

 

 

0Shares

Leave a Reply

Your email address will not be published. Required fields are marked *