Monday, June 10, 2013

Cent OS 6.4 as PuppetMaster 3.2.1 installation and configuration

What is Puppet?

Puppet is IT automation software that helps system administrators manage infrastructure throughout its

lifecycle, from provisioning and configuration to patch management and compliance. Using Puppet, you

can easily automate repetitive tasks, quickly deploy critical applications, and proactively manage

change, scaling from 10s of servers to 1000s, on-premise or in the cloud.

How Puppet Works

Puppet uses a declarative, model-based approach to IT automation.

Define the desired state of the infrastructure’s configuration using Puppet’s declarative

configuration language.
Simulate configuration changes before enforcing them.
Enforce the deployed desired state automatically, correcting any configuration drift.
Report on the differences between actual and desired states and any changes made enforcing the desired

state.

Puppet Master Server Install & Configuration

#vi /etc/hosts
192.168.100.1 master.puppet.bom master
192.168.100.2 client.puppet.bom client

#yum install puppet-server -y

#vi /etc/puppet/puppet.conf
dns_alt_name = master.puppet.bom

#vi /etc/sysconfig/puppet
PUPPET_SERVER=master.puppet.bom

#service puppetmaster restart && chkconfig puppetmaster on

#puppet cert list
#puppet cert sign client.puppet.bom

Now we need create "Puppet Policy" @/etc/puppet/manifest/site.pp

[root@master ~]# cat /etc/puppet/manifests/site.pp
# Create "/tmp/testfile" if it doesn't exist.
class test_class {
    file { "/tmp/testfile":
       ensure => present,
       mode   => 600,
       owner  => root,
       group  => root
    }
}

# tell puppet on which client to run the class
node default {
    include test_class
}

file {'/etc/puppet/files/MobileWorld.jar':
  ensure => present,
  mode   => '0777',
  owner  => 'root',
  group  => 'root',
  source => 'puppet:///files/MobileWorld.jar',
}
file {'/etc/motd':
                        source => 'puppet:///files/motd',
}

file {'/etc/puppet/files/mMobile.jar':
  ensure => present,
  mode   => '0777',
  owner  => 'root',
  group  => 'root',
  source => 'puppet:///files/mMobile.jar',
}

[root@master ~]#

Puppet Slave Install & Configuration

#vi /etc/hosts
#vi /etc/hosts
192.168.100.2 client.puppet.bom client
192.168.100.1 master.puppet.bom master

#yum install puppet -y

#vi /etc/puppet/puppet.conf
[agent]
server = master.puppet.bom

#vi /etc/default/puppet
START=yes

#service puppet restart && chkconfig puppet on

#puppet agent --test

At the client end need write a one crontab.

* * * 1 * puppet --onetime --no-daemonize --logdest syslog > /dev/null 2>&1
Post a Comment