Joni Junni

Installing and testing Puppet on Debian 7

Categories: [school]
Tags: [linux], [puppet], [linux-centralized-management-course]

Installing and configuring Puppet on Debian isn’t very different than in Ubuntu as they are practically the same platform. Here is my notes from testing Puppet on Debian.

Installing Puppet client

Installing the client is easy and can be installed straight from apt:

sudo apt-get update
sudo apt-get install puppet

(And yes, I have sudo installed on my Debian test box for convenience.)

First Puppet test program

When the installation is ready, you should test Puppet to make sure it is working. This can be done with a simple one line puppet program in terminal (Thanks to Tero for this nifty example):

puppet apply -e 'file { "/tmp/helloPuppet": content => "This is a Puppet example!\n" }'

If everything is working, you should see notice-line in the terminal window saying that the “content is defined as md5” etc.

If you try to run the same line again, you will only get response “Finished catalog run in x.xx seconds” as the file has not changed:

puppet-working

What if we change the content of the command? Let’s test it:

puppet apply -e 'file { "/tmp/helloPuppet": content => "This is a modified Puppet example!\n" }'

As we can see, Puppet detects that the file /tmp/helloPuppet has different content than what we told it in the command above and will update the file. When we run the same command again, it detects that the file does not differ from the content on our command and will not update it:

puppet-test-modified

Sources

– Introduction on Puppet at Linux Centralized Management course (Tero Karvinen) – http://terokarvinen.com/2013/aikataulu-%E2%80%93-linuxin-keskitetty-hallinta-%E2%80%93-ict4tn011-4-syksylla-2013 – Tero Karvinen: Hello Puppet revisited – on Ubuntu 12.04 – http://terokarvinen.com/2013/hello-puppet-revisited-%E2%80%93-on-ubuntu-12-04-lts