O'Reilly logo

Managing Infrastructure with Puppet by James Loope

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required