Sebastian Mogilowskis Blog

Just another blog about administration, linux and other stuff

Servermanagement with puppet – Part 1


The Environment:

Hosts:
puppetmaster: The puppetmaster
pc1: The first testclient
pc2: The second testclient

Domain: domain.local


Note: I used Ubuntu 9.04 in all servers.

Puppetmaster installation

aptitude install puppetmaster


Activate fileserver for the local network (”/etc/puppet/fileserver.conf”):

[files]
path /etc/puppet/files
allow *.domain.local

[plugins]
path /etc/puppet/files
allow *.domain.local


Note:You can allow a subnet, too. (”allow 192.168.0.0/24”).


Edit / Create the site file ”/etc/puppet/manifests/site.pp”:


This is puppets main configuration file. To test the configuration, we want to copy a file from the puppetmaster to the clients.

#
# site.pp
#

class filetest {
   file { '/etc/testfile':
      source => "puppet://puppetmaster.domain.local/files/etc/testfile"
   }
}

node default {
   include filetest
}

Now create the testfile and the directories:

mkdir -p /etc/puppet/files/etc
vim /etc/puppet/files/etc/testfile


Choose a content for this file “Hello World” for example.

/etc/init.d/puppetmaster restart

Client Installation

aptitude install puppet

Connect the puppet client to the server


Add the following content to the puppet configuration file /etc/puppet/puppet.conf to connect the client to the server.

[puppetd]
server=puppetmaster.domain.local
/etc/init.d/puppet restart


On the puppetmaster:

puppetca --list
puppetca --sign pc1.domain.local


A restart of puppet is the fastet way to test the configuration:

/etc/init.d/puppet restart


Now you should see the file /etc/testfile on each client.


In the next part of this howto, we will use some modules with puppet and create an example configuration for pratical use.

Links:

An introduction to using Puppet Teil 1
An introduction to using Puppet Teil 2

, , ,

2 thoughts on “Servermanagement with puppet – Part 1

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.