Use your business data to your advantage with the help of Syncfusion’s new data science offerings. Discover how a custom big data solution can provide your company with valuable predictions about key market trends.

Puppet 3 Cookbook

Cookbook

John Arundel August 2013

An essential book if you have responsibility for servers. Real-world examples and code will give you Puppet expertise, allowing more control over servers, cloud computing, and desktops. A time-saving, career-enhancing tutorial

$26.99

$44.99

RRP $26.99

RRP $44.99

eBook

Print + eBook

Want this title & more?

$21.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781782169765

Paperback274 pages

About This Book

Use Puppet 3 to take control of your servers and desktops, with detailed step-by-step instructions

Covers all the popular tools and frameworks used with Puppet: Dashboard, Foreman, and more

Teaches you how to extend Puppet with custom functions, types, and providers

Packed with tips and inspiring ideas for using Puppet to automate server builds, deployments, and workflows

Who This Book Is For

"Puppet 3 Cookbook" is for anyone who builds and administers servers, especially in a web operations context. It requires some experience of Linux systems administration, including familiarity with the command line, file system, and text editing. No programming experience is required.

Table of Contents

Chapter 1: Puppet Infrastructure

Introduction

Installing Puppet

Creating a manifest

Managing your manifests with Git

Creating a decentralized Puppet architecture

Writing a papply script

Running Puppet from cron

Deploying changes with Rake

Bootstrapping Puppet with Rake

Automatic syntax checking with Git hooks

Chapter 2: Puppet Language and Style

Introduction

Using community Puppet style

Checking your manifests with puppet-lint

Using modules

Using standard naming conventions

Using inline templates

Iterating over multiple items

Writing powerful conditional statements

Using regular expressions in if statements

Using selectors and case statements

Using the in operator

Using regular expression substitutions

Chapter 3: Writing Better Manifests

Introduction

Using arrays of resources

Using definitions

Using dependencies

Using tags

Using run stages

Using node inheritance

Passing parameters to classes

Using class inheritance and overriding

Writing reusable, cross-platform manifests

Getting information about the environment

Importing dynamic information

Passing arguments to shell commands

Chapter 4: Working with Files and Packages

Introduction

Making quick edits to config files

Using Augeas to automatically edit config files

Building config files using snippets

Using ERB templates

Using array iteration in templates

Using GnuPG to encrypt secrets

Installing packages from a third-party repository

Building packages automatically from source

Comparing package versions

Chapter 5: Users and Virtual Resources

Introduction

Using virtual resources

Managing users with virtual resources

Managing users' SSH access

Managing users' customization files

Efficiently distributing cron jobs

Using schedules to limit when resources can be applied

Using host resources

Using multiple file sources

Distributing directory trees

Cleaning up old files

Auditing resources

Temporarily disabling resources

Chapter 6: Applications

Introduction

Managing Apache servers

Creating Apache virtual hosts

Creating Nginx virtual hosts

Managing MySQL

Managing Ruby

Chapter 7: Servers and Cloud Infrastructure

Introduction

Building high-availability services using Heartbeat

Managing NFS servers and file shares

Using HAProxy to load-balance multiple web servers

Managing firewalls with iptables

Managing EC2 instances

Managing virtual machines with Vagrant

Chapter 8: External Tools and the Puppet Ecosystem

Introduction

Creating custom facts

Adding external facts

Setting facts as environment variables

Importing configuration data with Hiera

Storing secret data with hiera-gpg

Generating manifests with puppet resource

Generating manifests with other tools

Testing your manifests with rspec-puppet

Using public modules

Using an external node classifier

Creating your own resource types

Creating your own providers

Creating your own functions

Chapter 9: Monitoring, Reporting, and Troubleshooting

Introduction

Doing a dry run

Logging command output

Logging debug messages

Generating reports

Producing automatic HTML documentation

Drawing dependency graphs

Understanding Puppet errors

Inspecting configuration settings

What You Will Learn

Installing and setting up Puppet for the first time

Producing eye-catching reports and information for management

Understanding common error messages and troubleshooting common problems

Managing large networks

Taking control of configuration data with Hiera and encrypting secrets with GnuPG

Producing reliable, clean, maintainable code to community standards with puppet-lint and rspec-puppet

Using virtual machines to build test and staging environments, and production systems on cloud platforms such as EC2

Automating every aspect of your systems including provisioning, deployment and change management

Making Puppet reliable, performant, and scalable

In Detail

A revolution is happening in web operations. Configuration management tools can build servers in seconds, and automate your entire network. Tools like Puppet are essential to taking full advantage of the power of cloud computing, and building reliable, scalable, secure, high-performance systems. More and more systems administration and IT jobs require some knowledge of configuration management, and specifically Puppet.

"Puppet 3 Cookbook" takes you beyond the basics to explore the full power of Puppet, showing you in detail how to tackle a variety of real-world problems and applications. At every step it shows you exactly what commands you need to type, and includes full code samples for every recipe.

The book takes the reader from a basic knowledge of Puppet to a complete and expert understanding of Puppet’s latest and most advanced features, community best practices, writing great manifests, scaling and performance, and extending Puppet by adding your own providers and resources. It starts with guidance on how to set up and expand your Puppet infrastructure, then progresses through detailed information on the language and features, external tools, reporting, monitoring, and troubleshooting, and concludes with many specific recipes for managing popular applications.

The book includes real examples from production systems and techniques that are in use in some of the world’s largest Puppet installations, including a distributed Puppet architecture based on the Git version control system. You’ll be introduced to powerful tools that work with Puppet such as Hiera. The book also explains managing Ruby applications and MySQL databases, building web servers, load balancers, high-availability systems with Heartbeat, and many other state-of-the-art techniques

Authors

John Arundel

John Arundel has worked in the IT industry for most of his life, and during that time has done wrong (or seen others do wrong) almost everything that you can do wrong with computers. That comprehensive knowledge of what not to do, he feels, is one of his greatest assets as a consultant. He is still adding to it.

He spent much of his career working in very large corporations and, as a result, now likes to work with very small corporations. They like working with him too, not only because he can tell them about things that should not be done, but also because he can confidently inform them that big companies don't know what they're doing either.

Off the clock, he enjoys gardening, competitive rifle shooting, and other gentle hobbies. You can follow him on Twitter @bitfield. If your company is small enough, you can hire him there too.

Alerts & Offers

Series & Level

We understand your time is important. Uniquely amongst the major publishers, we seek to develop and publish the broadest range of learning and information products on each technology. Every Packt product delivers a specific learning pathway, broadly defined by the Series type. This structured approach enables you to select the pathway which best suits your knowledge level, learning style and task objectives.

Learning

As a new user, these step-by-step tutorial guides will give you all the practical skills necessary to become competent and efficient.

Beginner's Guide

Friendly, informal tutorials that provide a practical introduction using examples, activities, and challenges.

Essentials

Fast paced, concentrated introductions showing the quickest way to put the tool to work in the real world.

Cookbook

A collection of practical self-contained recipes that all users of the technology will find useful for building more powerful and reliable systems.

Blueprints

Guides you through the most common types of project you'll encounter, giving you end-to-end guidance on how to build your specific solution quickly and reliably.

Mastering

Take your skills to the next level with advanced tutorials that will give you confidence to master the tool's most powerful features.

Starting

Accessible to readers adopting the topic, these titles get you into the tool or technology so that you can become an effective user.

Progressing

Building on core skills you already have, these titles share solutions and expertise so you become a highly productive power user.