Read Pro Puppet Online

Authors: Jeffrey McCune James Turnbull

Pro Puppet (6 page)

BOOK: Pro Puppet
6.57Mb size Format: txt, pdf, ePub
ads

Note
Installing the
puppet
,
puppetmaster
, and
facter
packages will also install some prerequisite packages, such as Ruby itself, if they are not already installed.

Installing on OpenSolaris

Installing Puppet on OpenSolaris requires installing Ruby first. Then install Puppet and Facter via a RubyGem. Start by using the
pkg
command to install Ruby.

# pkg install -q SUNWruby18

Once Ruby is installed (it can take a little while to download and install), there are two ways to install Puppet. The first is to use the RubyGems packaging system. RubyGems is installed by default when the SUNWruby18 package is installed. You can use the
gem
command to install the required Gems.

# gem install puppet facter

Alternatively, if you use Blastwave packages, Puppet and Facter are also available from the Blastwave repositories at
http://www.blastwave.org
and can be added using the
pkgutil
command.
Further instructions are available on the Puppet wiki at
http://projects.puppetlabs.com/projects/puppet/wiki/Puppet_Solaris
.

Installing from Source

You can also install Puppet and Facter from source tarballs. We don’t recommend this approach because it makes upgrading, uninstalling and generally managing Puppet across a lot of hosts difficult. To do this you’ll need to ensure some prerequisites are installed, for example Ruby and its libraries, using the appropriate packages for your host or via source again. First, download the Facter tarball from the Puppet Labs site.

$ cd /tmp
$ wget http://puppetlabs.com/downloads/facter/facter-1.5.7.tar.gz

Unpack the tarball and run the
install.rb
script to install Facter.

$ tar -zxf facter-1.5.7.tar.gz
$ cd facter-1.5.7
# ./install.rb

This will install Facter into the default path for Ruby libraries on your host, for example
/usr/lib/ruby/
on many Linux distributions.

Next, we need to download and install Puppet using the same process:

$ cd /tmp
$ wget http://puppetlabs.com/downloads/puppet/puppet-2.6.1.tar.gz
$ tar -zxf puppet-2.6.1.tar.gz
$ cd puppet-2.6.1
# ./install.rb

Like the Facter steps, this will install Puppet into the default path for Ruby libraries on your host.

Note
You can find the latest Puppet and Facter releases at
http://projects.puppetlabs.com/projects/puppet/wiki/Downloading_Puppet
.

Installing on Microsoft Windows

Since version 2.6.0, Puppet has supported running on Microsoft Windows. For the 2.6.0 release Puppet only manages a limited subset of configuration, primarily managing files, but other configuration types should be available in later releases.

Installing Puppet on Microsoft Windows can be achieved a couple of different ways, but the first step of both methods is to install Ruby. The easiest way to do this is with the Ruby One-Click Installer available at
http://rubyinstaller.rubyforge.org/wiki/wiki.pl?RubyInstaller
. You can also download binaries at
http://www.ruby-lang.org/en/downloads/
if you wish.

We’re going to use the One-Click installer. Download the latest version, which at the time of writing is at
http://rubyforge.org/frs/download.php/47082/ruby186-27_rc2.exe
. Run the downloaded executable and install Ruby. During the installation, select the
Use RubyGems
tick box.

Once Ruby is installed, start the RubyGems Package Manager from the start menu:

Programs -> Ruby-186-27 -> RubyGems -> RubyGems Package Manager

From the command window that opens, you can then install the Facter and Puppet gems.

C:\gem install puppet facter
Installing on other Platforms

We’ve just explained how to install Puppet on some popular platforms. Puppet can also be installed on a wide variety of other platforms. Puppet is also available in varying versions on:

Note
You can find a full list of additional operating systems and specific instructions at
http://projects.puppetlabs.com/projects/puppet/wiki/Downloading_Puppet
.

Puppet’s tarball also contains some packaging artifacts in the
conf
directory, for example an RPM spec file and OS X build scripts, that can allow you to create your own packages for compatible operating systems. Now you’ve installed Puppet on your chosen platform, we can start configuring it.

Configuring Puppet

Let’s start by configuring a Puppet master that will act as our configuration server. We’ll look at Puppet’s configuration files, how to configure networking and firewall access and how to start the Puppet master. Remember that we’re going to be looking at Puppet in its client-server mode. Here, the Puppet master contains our configuration data, and Puppet agents connect via SSL and pull down the required configuration.

On most platforms, Puppet’s configuration will be located under the
/etc/puppet
directory. Puppet’s principal configuration file is called
puppet.conf
and is stored at
/etc/puppet/puppet.conf
. It is
likely that this file has already been created when you installed Puppet, but if it hasn’t, then you can create a simple file using the following command:

# puppetmasterd --genconfig > puppet.conf

Note
We’re assuming your operating system uses the
/etc/
directory to store its configuration files, as most Unix/Linux operating systems and distributions do. If you’re on a platform that doesn’t, for example Microsoft Windows, substitute the location of your
puppet.conf
configuration file.

The
puppet.conf
configuration file is constructed much like an INI-style configuration file and divided into sections. Each section configures a particular element of Puppet. For example, the
[agent]
section configures the Puppet agent, and the
[master]
section configures the Puppet master binary. There is also a global configuration section called
[main]
. All components of Puppet will set options specified in the
[main]
section.

Note
On releases before 2.6.0, each section was named for the Puppet binary command rather than the function, for example the
[master]
section was called
[puppetmasterd]
and the
[agent]
section was
[puppetd]
. If you have this older style configuration, then Puppet 2.6.0 and later versions will prompt you to update your configuration file when you start Puppet.

At this stage, we’re only going to add one entry,
certname
, to the
puppet.conf
file. The
certname
option specifies the name of the Puppet master. We’ll add the
certname
value to the
[master]
section (if the section doesn’t already exist in your file, then create it).

[master]
certname=puppet.example.com

Replace
puppet.example.com
with the fully qualified domain name of your host.

Note
We’ll look at other options in the
puppet.conf
file in later chapters.

Adding the
certname
option and specifying our fully qualified domain name does two things: it makes troubleshooting certificate issues easier, and it addresses a bug with the Ruby SSL code present on many Linux-based hosts. This bug requires that we manually specify the name used by your Puppet master’s SSL certificates. You can read more about the precise bug at
http://projects.puppetlabs.com/projects/puppet/wiki/Ruby_Ssl_2007_006
.

BOOK: Pro Puppet
6.57Mb size Format: txt, pdf, ePub
ads

Other books

Teach Me a Lesson by Jasmine Haynes
Kiss of The Christmas Wind by Janelle Taylor
My Father's Dragon by Ruth Stiles Gannett
An Heir of Uncertainty by Everett, Alyssa
Searching for Cate by Marie Ferrarella
The Mute and the Liar by Victoria Best
La cabeza de un hombre by Georges Simenon
Sean's Sweetheart by Allie Kincheloe