Free Sample
+ Collection

Puppet 3 Cookbook

John Arundel

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
RRP $26.99
RRP $44.99
Print + eBook

Want this title & more?

$12.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
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
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
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
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
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
Managing Apache servers
Creating Apache virtual hosts
Creating Nginx virtual hosts
Managing MySQL
Managing Ruby
Chapter 7: Servers and Cloud Infrastructure
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
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
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 classes and inheritance to write powerful Puppet code
  • Deploying configuration files and templates for lightning-fast installations
  • 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


Read More