Step
1 :-
Install
RHEL EPEL repository on Centos 6.x on each system
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
Step 2 :-
Install Puppet on system
On Master sever :-
[root@PUPPET-MASTER ] # yum install puppet-server
[root@PUPPET-MASTER ] # /etc/init.d/puppetmaster start
On all client agent system :-
[root@PUPPET-CLIENT1 ~] # yum install puppet
[root@PUPPET-CLIENT1 ~] # /etc/init.d/puppet restart
Step 3 :-
Configuration
On
all
client
agent
system
:-
[root@PUPPET-CLIENT1
~] # vim /etc/puppet/puppet.conf
Add
below parameter into agent section
server
= PUPPET-MASTER
runinterval
= 120
[root@PUPPET-CLIENT1 ~] # /etc/init.d/puppet restart
Step 4 :-
On Master sever :-
List all cerificates from all clinet connected to server.
[root@PUPPET-MASTER ] # puppetca -l
"PUPPET-CLIENT1" (E3:2B:85:FD:56:2E:34:A3:E0:FF:7A:33:3A:36:33:8C)
Sign all cerificate using below command
[root@PUPPET-MASTER ] # puppetca -s PUPPET-CLIENT1
Step 5 :-
On
all client agent system
[root@PUPPET-CLIENT1 ~] # puppet agent --test
info: Caching catalog for ug-th-0215-nn
notice: Finished catalog run in 0.10 seconds
[root@PUPPET-CLIENT1 ~] #
Above command say successful connection to sever with certificate .
Step 6 :-
Push customize conf files from master to server.
[root@PUPPET-MASTER ] # vim /etc/puppet/manifests/site.pp
Add below entry into site.pp
import 'nodes.pp'
Step 7 :-
Create nodes.pp file
[root@PUPPET-MASTER ] # vim /etc/puppet/manifests/nodes.pp
node 'PUPPET-CLIENT1' {
include nginx
}
node 'PUPPET-CLIENT2' {
include nginx
}
[r
Step 8 :-
[root@PUPPET-MASTER
] # mkdir -p /etc/puppet/modules/nginx/{manifests,files}
lets
create the nginx
class
file
which
lives in /etc/puppet/modules/nginx/manifests/init.pp
[root@PUPPET-MASTER
] # vim /etc/puppet/modules/nginx/manifests/init.pp
#
Manage nginx webserver
class
nginx {
package
{ 'nginx':
ensure
=> installed,
}
service
{ 'nginx':
ensure
=> running,
}
file
{ 'nginxconfig':
name
=> '/etc/nginx/nginx.conf',
source
=> 'puppet:///modules/nginx/nginx.conf',
}
}
Add
customize file into /etc/puppet/modules/nginx/files/
Step
9 :-
[root@PUPPET-MASTER
] #
puppet apply /etc/puppet/manifests/site.pp
Step
10 :-
Login
to client system and check for /etc/nginx/nginx.conf you will get your customize file , it will take 2 min to update client system.
Step 11(Optional) :-
Hadoop Manifests
# Make sure /etc/puppet/module/ have permission of puppet puppet , unzip your hadoop file /etc/puppet/modules/hadoop/files/
class hadoop{
group { "hadoop":
ensure => present,
gid => 1000,
}
user { "hadoop":
ensure => present,
shell => "/bin/bash",
managehome => true,
home => "/home/hadoop",
password => '$1$jE8T0sFs$PMKB4bfP21IRqzZ14mwTR/',
}
file { "Hadoophome":
name => "/home/hadoop",
ensure => "directory",
owner => "hadoop",
group => "hadoop",
mode => 700,
}
file { "hadoopconf":
name => "/usr/local/hadoop",
recurse => true,
ensure => "directory",
owner => "hadoop",
group => "hadoop",
mode => 755,
source => 'puppet:///modules/hadoop/hadoop/',
}
}