Difference between revisions of "User:Prathapan"

From CDOT Wiki
Jump to: navigation, search
Line 228: Line 228:
  
 
[http://projects.puppetlabs.com/projects/puppet/wiki  puppet wiki page]
 
[http://projects.puppetlabs.com/projects/puppet/wiki  puppet wiki page]
 +
 +
 +
== '''Release 0.3 ''' ==
 +
 +
Fully configuration Documents

Revision as of 12:19, 23 April 2011

Hi, My name is Pirathapan Sivalingam. Currently enrolled in 6th semester.

My IRC nick is Prathapan.

What else, Finished my CCNP certification and Going take CCVP in few months, then hoping to get CCIE.


Project Release 0.1

Project-SETUP PUPPET

Release 0.1

Puppet

Puppet is an open source automated system configuration management framework, which provides administrators a simplified platform for flexible and consistent administration.

Puppet element includes

1) Puppet master: it is the centralized system that has configuration of the other nodes that is to be applied on the client system.

2) Puppet: it is installed in the clients that are to be managed by puppetmaster.

How puppet works

All clients will communicate with puppet master periodically to see if there are any changes for respective configuration, and download the latest configuration and make sure it is synchronize with that configuration. Once the configuration applied, it will report to the puppet master asking if there is anything needs to be changed.

Usually, the changes on the configuration in puppet master is done, it will be applied every 30 minutes on the clients.

Note: Puppet will only make any changes to the system if the system state does not match the configured state.

Lets look at technically, how puppet works by step by step.

1) Puppet generates the certificate using the system’s FQDN, when puppet starts first time.

2) Puppet submits the generated certificate to the puppetmaster. The puppetmaster will will need to sign the certificate before clients can be considered authenticated.

3)Puppet waits for 300 seconds for the signed certificate. If the puppet does not get the certificate with on 300 seconds(can be configured for different value), it will quit.

4)Puppetmaster signs the certificate. It can be configured such a way to automaticall sign the certificate, but it is NOT good idea. Other way is to manually sign the certificate.

To manually sign the certificate

#puppetca –sign <certificate CN>

note: it is done in puppet master. To list the requsete certificate, issu the commad

#puppetca –list

5)Puppet receives the signed certificate. Once the puppet receives the certificate, it will start configuration run immediately.

Note: Make sure the time on the puppetmaster and puppet to be same.

6) The puppet generates all the facts. Most configurations rely on client information to make decisions. When the Puppet client starts, it loads the Facter Ruby library, collects all the facts it can, and passes those facts to the interpreter. When you use Puppet over a network, these facts are passed over the network to the server and the server uses them to compile the client’s configuration.

7) Puppetmaster parses it’s manifests.

Puppet receives the manifests.

9) The puppets applies it’s manofests.

10) While the puppet applies the manifest, it pulls files from the puppetmaster’s fileserver after checking the local checksum against the remote checksum.

11) puppet sends the copy of the configuration file it replace to the puppet master.

12) puppet will send the report to the puppetmaster.

13) puppet waits for next 30 minutes by default for the next run.

Note: the files and templates are transferred using SSL communication.


Supported system platform

Linux

Fedora 7 and late r

SuSE linux 8 and later

RHEL 3 and later

Ubuntu 7 and later

Debian 3.1 and later

Unix

Macintosh OS X and later

Sun solaris 7 and later

HP-UX

Windows


Installing puppet.

Since I will be installing on fedora system, I will be writing the post based on the fedora related configuration.

Installing can be done in many ways whether downloading tarballs and then install or using yum. I would prefer using yum because it will install all the needed repository.

I installed on the fedora11 on my system, believe be it gave huge pain tying to get it working. There was lot missing necessary files and folder left not installed on the system. I tried many times to consult what the problems were behind this installations, even I consulted on #puppet on IRC chat, was not able get problem fixed. I will write about the problem were later on my post.

Eventually I gave up installing on fedora11, and that where Fedora 13 comes on the task. I had to install Fedora13 and then I Installed puppet on the fedora13 system, and it all went very well so far. The entire initial configuration is done on my fedora 13. Therefore, any what I refer here will refer as Fedora13.

This installations were done in fedora 12 systems that are Hongkong & Ireland systems in proximity.on.ca domain.

1) Install puppetmaste and puppet.

On server, In this case it will be Hongkong.proximity.on.ca

#yum install puppet-server

it will install puppetmaster and puppet on the server which is to be as puppetmaster.

#yum install mysql-server  ruby-mysql
#yum install ruby-RRDtool

it will install ruby library.

On client, in this case it will be Ireland.proximity.on.ca

#yum install puppet

it will install puppet client on the client system.

2) the puppetmaster/puppet configuration file is /etc/puppet/puppet.conf

in this file there are four most important section which are

main: Primarily file locations, directory settings and other globals applicable to both the puppet as well as the puppetmaster.

Puppetca: Puppet Certificate Authority (puppetca) settings

Puppetd: puppet client daemon setting.

Puppetmasterd: puppetmaster daemon setting.

3) Make sure all the needed files and folders are created by the installation process.

On the server, Hongkong

  1. ls /etc/puppet

shoul have auto.conf , fileserver.conf, manifest puppet.conf


Some of the Puppet resourses

1)Files

2)Services

3)Packages

4)Cron jobs


4) Create a simple manifest.

a) carete sudo.pp, vi /etc/puppet/manifests/class/sudo.pp

# /etc/puppet/manifests/classes/sudo.pp
class sudo {
    file { "/etc/sudoers":
        owner => "root",
        group => "root",
        mode  => 440,    }
}
b) create site.pp, vi /etc/puppet/manifests/site.pp
  1. /etc/puppet/manifests/site.pp

import "classes/*" node default { include sudo }

c) start the puppet master.

#puppetmasterd –mkusers

this option will create the puppet user that is needed.

Once the puppetmaster daemon is stated, it will create the necessary files and folders under /var/lib/puppet.

#ls /var/lib/puppet

should have bucket, clientsbucket, facts, reports, ssl, yaml, class.txt, client_yaml, l ib, rrd, state

all the details information about these files and folder will be included in the next blog.

#service puppetmaster start

d) start the puppet client.

On the client, Ireland

#puppetd –verbose

when the puppet client daemon starts, it creates the necessary certificate and waits for the certificate to be signed by the puppetmaster. 3)sign the certificate.

On the server

#puppetca –list

this will list the all the requested certificate that are to be signed by puppetmaster.

#puppetca –-sign ireland.proximity.on.ca


Release 0.2

Functional with file server

1) file server configuration: For the the configuration to be saved

2) Some of the manifest

puppet main page

puppet wiki page


Release 0.3

Fully configuration Documents