The godfather

Ever since I heard about puppet the only thing that comes to mind when thinking about it is the nice little image in the Godfather book.
Was tasked to run puppet on my machine and get to know it better.

Puppet people provide a VM that you could use to manage,  me being lazy decided to install both the client and the puppetmaster on the same machine, this way I could waste time doing other things.

So here goes.

Install the packages  puppet and puppet server on the same method

Starting puppetmasterd like this would be nice

/usr/bin/ruby /usr/sbin/puppetmasterd -d -l syslog -v or
/usr/bin/ruby /usr/sbin/puppetmasterd -d -v --no-daemonize

I run my client like so

/usr/bin/ruby /usr/sbin/puppetd -d -w 120 --server sa-kishore-k.mydomain.com        <--- This points to the name of my machine

Also you should add an entry in the /etc/hosts file directing

127.0.0.1 sa-kishore-k.mydomain.com
, client couldn’t talk to the master without this(but you know better) .

it will request the server for a certificate signing so the that the client could pull the
configuration stuff from the server.

One multi machine client server style we should manually sign the incoming request, using

puppetca -l and puppetca -sign <client>

This will allow the client machines to talk to the server and retrieve its manifests.

Since we are running both the master and the client on the same machine I found that the certificate was already signed.

The manifest/site.pp is the first one that the clients look at.  The rest of the things could be learnt at the nice puppet doc.

Some things to note were when I needed to install a bunch of modules and make the clients run them, I had to

cat  /etc/pupet/manifests/modules.pp
# All the modules that we want run
import "apache"
import "snmpd"


cat /etc/puppet/manifests/site.pp
#site
import "modules.pp"     << include the modules
import "test_file.pp"
import "test_file_source.pp"
node default {        <-- Define what modules the nodes will run by default
include apache
include snmpd
}

While addressing some files using the source tag don’t put in the files directory in the path


source => 'puppet:///modules/nginx/nginx.conf.port8080',   <-- This skipping the files folder that we see below

The nginx module that I created actually looks like this

.
|-- files
|   `-- nginx.conf.port8080
|-- init.pp
`-- README

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: