Book review: Pulling Strings With Puppet

The devops movement (if you haven’t seen Ben Rockwood’s presentation on devops you should go watch it now) has been gaining steam over the past few years, and the movement has led to a lot of organizations adopting automation solutions like CFEngine, Chef or Puppet. I’ve had great success with puppet so far, and my fellow blogging partner Mike has had similar success with CFEngine. Maybe Mike will come out of hibernation and give everyone an update on the cool things he’s done with it. :)

When I first started using Puppet I purchased a copy of James Turnbull’s Pulling Strings with Puppet. I’m your atypical learner who likes to sit in a recliner with a hard cover book and read it from beginning to end. Then I will go back through each chapter and experiment with the items I highlighted. This book had A LOT of material to experiment with, and is broken up into seven chapters:

Chapter 1. Introducing Puppet
Chapter 2. Installing and Running Puppet
Chapter 3. Speaking Puppet
Chapter 4. Using Puppet
Chapter 5. Reporting on Puppet
Chapter 6. Advanced Puppet
Chapter 7. Extending Puppet

The introduction and installation chapters helped me understand the pupper architecture, and the purpose of the various daemons that run on the puppetmaster. I also enjoyed the description of facter, which is one of the most useful software applications I’ve come across (and it’s useful outside of Puppet). The description of the runtime flags was also extremely handy, and it made debugging my initial configuration issues quite easy.

The chapter on using puppet was also well put together. It did a good job of describing classes, resources, inheritance, variables, scoping, arrays, conditionals, nodes, facts and resource types. I’ve referenced this chapter many times since putting together my first set of manifests, and when you combine it with the latest resource type descriptions on the puppet site you will have everything you need to define your resources.

I found the last three chapters useful for seeing how to deploy puppet in a real world scenario. It also touched on how to tie a version control system into puppet, which is a must when you are centralizing your configuration management duties. These chapters also touched on external node classifiers, which allow you to retrieve a set of nodes from an external source (LDAP, CMDB, etc.). This becomes essential essential when you are managing thousands of machines, since it becomes a pain to constantly be editing files when devices are added or removed (I’m assuming you have an automated solution to handle node additions and removals from your network).

Pulling Strings with Puppet was a solid book, and I would definitely give it a 5/5. Early on I stumbled trying to figure out how to classify everything, but after a lot of trial and error I’ve finally come up with a layout that does everything I need and is easy to manage. It’s also a piece of cake to extend my configuration as new services come online. I’m hoping to start playing around with chef next month, and plan to do a side-by-side comparison of the two later this year. There are things I like about each solution, so this should be a whole bunch of fun!!

Installing and using facter on Solaris and Linux hosts

I have been playing around with puppet, which is an awesome configuration management tool. Puppet allows you to apply configurations to nodes based on one or more facts (a fact is a specific piece of information, such as a list of network interfaces), which includes everything from operating system information to the network configuration. To gather this information, puppet uses facter, which provides a consistent way to locate information about a machine in a machine independent way. To install facter, you can use your favorite package manager, or run the following to install from source:

$ tar xfvz facter-1.5.tgz

$ cd facter-1.5

$ ruby install.rb

Once facter is installed, you can use the facter program to list all of the available facts on your system:

$ facter | head -5
architecture => x86_64
domain => prefetch.net
facterversion => 1.5.4
fqdn => disarm.prefetch.net
hardwareisa => x86_64

To retrieve the value of a fact, you can run facter with the name of the facts you want to display:

$ facter hostname interfaces macaddress
hostname => kvmnode1
interfaces =>
macaddress => 54:52:00:53:20:00

I’m hoping to start writing about puppet, and my experiences using it to manage my lab. It’s an addictive piece of software, and can save admins lots and lots of time!