Pull Based Configuration Management Tool
Pull configuration nodes checks out with the servers periodically and fetches the configuration about it. In simple language, here PCs automatically check upon themselves whether they need an update or not? So the PCs pull the updates from the servers.
The most famous tool used for pull based configuration is Chef but some people may also use Puppet.
What is Chef?
Chef is a famous Pull-Based Configuration tool used to automate a lot of work. Some factoids about it are as follows:
Chef tool was made using Ruby and Erlang Language.
It's used to automate admin tasks.
It's an open source software.
Chef Architecture
Basically it consists of a workstation, a chef-server and a number of nodes(PCs).
Workstation
Chef-server
Nodes
Installation Process
To install Chef on your Linux machines use these following commands:
sudo su
wget https://packages.chef.io/files/stable/chef-workstation/0.4.2/el/7/chef-workstation-0.4.2-1.el6.x86_64.rpm
yum install chef-workstation-0.4.2-1.e16.x86 64.rpm -y
Keep in mind version may differ.
Chef Commands
Create a directory which store all the cookbook
mkdir cookbooks
Create a file/cookbook inside the cookbooks.
chef generate cookbook test-cookbook #test-cookbook is name of a cookbook cd test-cookbook
Create a recipe.
chef generate recipe test-recipe #test-recipe is name of a recipe cd ..
Write a code to install & deploy Apache server.
#open vi editor to write the code in ruby language vi test-cookbook/recipe/test-recipe.rb
package 'httpd' do action :install end file '/var/www/html/index.html' do content 'Apache server installed' action :create end service 'httpd' do action [:enable, :start] end
Run the code.
chef-client -zr "recipe[test-cookbook::test-recipe]"
That's all about today, I guess you and me both learnt something new today. Hope you find my notes easy to understand.