Pulling Strings With Puppet - James Turnbull [7]
Resources
There are a number of useful resources available to get you started with Puppet.
Web
• Puppet documentation:
• Puppet FAQ:
• About Puppet:
• Introduction to Puppet:
• Who is using Puppet:
Mailing Lists
• Puppet mailing lists:
IRC
• Puppet IRC channel:
CHAPTER 2
Installing and Running
Puppet
This chapter focuses on installing and running Puppet master servers and clients (also known as nodes). There are a variety of methods you can use to install Puppet masters and clients: from source, packages, or as a Ruby Gem. This chapter will take you through the steps required for installation using each of these methods.
The Puppet server and clients are designed to run on Unix and Linux platforms; currently there is no port for Windows (although it may be possible to run Puppet under Cygwin). This book will only cover installation on Unix and Linux platforms. Both the master server and the clients will run successfully on a variety of BSD flavors, Linux distributions, Sun Solaris, Mac OS X, and indeed most Unix-like platforms that support Ruby.
The chapter will also take you through configuring and running both the Puppet master and client. By the end of this chapter, you should have an introduction to how both the master and clients can be configured. You will also be able to start and stop the master and clients on a variety of platforms.
Note - When referring to the Puppet client, we'll distinguish between the terms client and node. The term client refers to the Puppet client daemon that connects to the Puppet master and retrieves the configuration. The term node refers to the underlying host to which configuration is applied.
Installation Prerequisites
The process of installing Puppet's master and client components is quick and easy, but you will need to install some prerequisites first. The prerequisites are required for both hosts that run the Puppet master or client (or both-your Puppet master can also be a Puppet node). These prerequisites include the Ruby interpreter, select Ruby libraries, and Facter.
Installing Ruby
As Puppet is a Ruby-based application, the first thing you need to ensure you have installed is Ruby and a few key Ruby libraries. These days, many Linux and other Unix-like platforms come with a Ruby package, and you can install this package and any required library packages. If your distribution does not have a package, you can install Ruby from source.
Installing Ruby from Source
You can download the latest Ruby source package from http: //www. rubylang. org/en/downloads/. To support Puppet, you will need at least Ruby version 1.8.1 or higher. The current Ruby release, at the time of writing, is 1.8.6. Download the source package and unpack it.
Change into the resulting directory and configure the package.
By default, on most systems the Ruby binary will be installed into /usr/local/bin. You can override this with the --prefix configure option like so:
Here I've specified /usr as the target prefix directory. Next, we need to make and install the Ruby files like so:
You can now test that Ruby is installed by executing the following:
If your Ruby version is returned, installation has been successful. If it is not returned, confirm the ruby binary is in your path or check any error messages from the make and/or installation process. Installing Ruby in this manner will install all of the required libraries that Puppet needs to function properly.
Installing Ruby and Ruby Libraries from Packages
Many Linux distributions and Unix operating systems have Ruby packages available for them. These include Red Hat Enterprise Linux and Fedora, Debian, Ubuntu, SuSE, and Mandriva. Some distributions bundle all the required Ruby binaries and libraries in a single package. Other distributions separate the core development