A beginners guide to programming and automating stuff

Puppet – What is Puppet

Puppet is a solution that lets you control whats installed/configured on multiple machines from a single central machine. This single central machine is referred to as the “Puppet Master”, and the machines it controls are called “Puppet Agents” (aka nodes or slaves).

To follow along with this tutorial series, you first need to set up your own puppet sandpit environment, this should comprise of 2 or more machines, one of which acts as the puppet master, and the rest act as puppet agents. Installing and setting up the Puppet Master and it’s Agents is covered in the next lesson.

In a puppetised environment, each agent checks-in with the puppet-master to see if it is set up the way it’s supposed to. If the answer is yes then nothing happens, if not, then the puppet master tells the agent what it should look like, then the node makes changes to itself accordingly to reflect this.

The way this works is that on the puppet master you can define a “Desired State” for each of your nodes.  This desired state is declared in a syntax similar to a hash table’s syntax.

If a node doesn’t resemble a desired state, then we say that a “drift” has occurred.  A drift is identified every 30 minutes, where the following happens:

  1. The node sends it current setup info (referred to as “FACTS”) to the Puppet master.
  2. The Puppet master uses the facts to compile a “catalog”. This catalog contains detailed data about how the node should be configured.
  3. The Puppet master sends the catalog back to the node.
  4. The node enforces the changes as described in the the catalog
  5. The node then sents a “Report” back to the puppet master. You can view these reports and integrate them with other systems.

In the next lesson we’ll walk through how to set up your own puppet environment which you can then experiment on to learn puppet.

Useful Links
– really good intro to puppet – this is a the full puppet reference manual. – really good puppet blog aggregator.