Puppet is an open source framework and
toolset for managing the configuration of computer systems.
From sometime, I wanted to learn some
tricks on Puppet.This weekend I finally made up my mind and did some very basic
stuff with puppet
My goal was to push a file resource
from the puppet server to the client. I used the Ubuntu 12.04 machines for
testing. If one doesn’t want to install the whole thing then, pre-configured VM
can be downloaded from http://info.puppetlabs.com/download-learning-puppet-VM.html
So, lets start.
Installing Puppet master on Linux
aptitude install puppetmaster
Installing Puppet client
aptitude install puppet
Connecting the Puppet Client to the Server
puppet cert –sign “desktop”
We have to sign the client
puppet cert –sign “desktop”
Output :
notice: Signed certificate request for my-desktop
notice: Removing file Puppet::SSL::CertificateRequest my-desktop at ‘/var/lib/puppet/ssl/ca/requ
Creating the First Manifest
On the server move to folder
/etc/puppet/manifests, create a “node.pp” file,
gedit nodes.pp
node ‘my-desktop’ {
file { “/tmp/hello.txt”:
content => “Hello, My First Manifest”,
}
}
Create “site.pp” in the same folder
gedit sites.pp
import ‘nodes.pp’
$puppetserver = ‘ubuntu.home’
From the client run the command
puppet agent –test
Output :
info: Caching catalog for my-desktop
info: Applying configuration version ’1370675206′
notice: Finished catalog run in 0.03 seconds
After this when we check the /tmp/
folder , we can see the file is in tmp folder on the client.
What Just happened ?
I am a beginner on the puppet. My
Explanations may not be right, but these are my observations.
We installed a Puppet Master server
We installed a Puppet client
Added the client to the Puppet Masters
visibility,i.e. server-client interaction
Created first Manifest. A “Manifest” is
a puppet’s way of telling the configuration information to the client.Example :
If we see the nodes.pp file, there is a
Resource, which a “File Resource”, called “hello.txt” defined for a client
“my-desktop with the content “Hello, My first Manifest ”. A resource should be
applied to the client when client requests it. This can be a package or file
etc. (this case it is a file).
When puppet client contacts the server
for the resource, it will get the file in its “tmp ” folder. (Resource is
“/tmp/hello.txt”)
So for now, this just a beginning of my
date with Puppet.
No comments:
Post a Comment