Chapter 1. Baby Steps to Automation

Puppet is a configuration management framework with an object-oriented twist. It provides a declarative language syntax and an abstraction layer that allow you to write heavily reusable and understandable configuration definitions. In this chapter, I’ll cover the basics of the Puppet programs, the language syntax, and some simple class and resource definitions.

Getting the Software

A Puppet deployment comes with a couple of pieces of software. For the most part, these can be installed from your chosen Linux distribution’s package manager. Alternatively, you can use the packages or source provided by Puppet Labs at http://www.puppetlabs.com/misc/download-options/. In my examples, I’ve used Ubuntu Linux 11.04, but the packages are very similar in each distro. There are generally two packages: the Puppet package itself, which comes with Facter, and the Puppet Master server. For the purposes of this chapter, the Puppet and Facter package will suffice. When installed, it will include an init script to start an “agent” daemon at boot, which will look for a Puppet Master. For simplicity’s sake, we will test manifests from the command line using the puppet apply command to begin:

  • Ubuntu: apt-get install puppet

  • Fedora: yum install puppet

  • Mac OS X: port install puppet

Get Managing Infrastructure with Puppet now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.