Book Image

Puppet 3: Beginner's Guide

By : John Arundel
Book Image

Puppet 3: Beginner's Guide

By: John Arundel

Overview of this book

<p>Everyone's talking about Puppet, the open-source DevOps technology that lets you automate your server setups and manage websites, databases, and desktops. Puppet can build new servers in seconds, keep your systems constantly up to date, and automate daily maintenance tasks. <br /><br />"Puppet 3 Beginner's Guide" gets you up and running with Puppet straight away, with complete real world examples. Each chapter builds your skills, adding new Puppet features, always with a practical focus. You'll learn everything you need to manage your whole infrastructure with Puppet.<br /><br />"Puppet 3 Beginner’s Guide" takes you from complete beginner to confident Puppet user, through a series of clear, simple examples, with full explanations at every stage.</p> <p>Through a series of worked examples introducing Puppet to a fictional web company, you'll learn how to manage every aspect of your server setup. Switching to Puppet needn't be a big, long-term project; this book will show you how to start by bringing one small part of your systems under Puppet control and, little by little, building to the point where Puppet is managing your whole infrastructure.</p> <p>Presented in an easy-to-read guide to learning Puppet from scratch, this book explains simply and clearly all you need to know to use this essential IT power tool, all the time applying these solutions to real-world scenarios.</p>
Table of Contents (17 chapters)
Puppet 3 Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Summary


A quick rundown of what we've learned in this chapter.

Configuration management

Manual configuration management is tedious and repetitive, it's error-prone, and it doesn't scale well. Puppet is a tool for automating this process.

You describe your configuration in terms of resources such as packages and files. This description is called a manifest.

What Puppet does

When Puppet runs on a computer, it compares the current configuration to the manifest. It will take whatever actions are needed to change the machine so that it matches the manifest.

Puppet supports a wide range of different platforms and operating systems, and it will automatically run the appropriate commands to apply your manifest in each environment.

The Puppet advantage

Using Puppet addresses a number of key problems with manual configuration management:

  • You can write a manifest once and apply it to many machines, avoiding duplicated work

  • You can keep all your servers in sync with each other, and with the manifest

  • The Puppet manifest also acts as live documentation, which is guaranteed to be up to date

  • Puppet copes with differences between operating systems, platforms, command syntaxes, and so on

  • Because Puppet manifests are code, you can version and manage them in the same way as any other source code

Scaling

The problems with manual configuration management become acute when your infrastructure scales to 5-10 servers. Beyond that, especially when you're operating in the cloud where servers can be created and destroyed in response to changing demand, some way of automating your configuration management is essential.

The Puppet language

Puppet manifests are written in a special language for describing system configuration. This language defines units called resources, each of which describes some aspect of the system: a user, a file, a software package, and so on:

package { 'curl':
  ensure => installed,
}

Puppet is a declarative programming language: that is, it describes how things should be, rather than listing a series of actions to take, as in some other programming languages, such as Perl or shell. Puppet compares the current state of a server to its manifest, and changes only those things that don't match. This means you can run Puppet as many times as you want and the end result will be the same.