You are previewing Pro Puppet.

Pro Puppet

Cover of Pro Puppet by James Turnbull... Published by Apress
  1. Copyright
  2. About the Authors
  3. About the Technical Reviewer
  4. Acknowledgments
  5. Introduction
  6. 1. Getting Started with Puppet
    1. 1.1. What Is Puppet?
      1. 1.1.1. Deployment
      2. 1.1.2. Configuration Language and Resource Abstraction Layer
      3. 1.1.3. Transactional Layer
    2. 1.2. Selecting the Right Version of Puppet
    3. 1.3. Can I mix releases of Puppet?
    4. 1.4. Installing Puppet
      1. 1.4.1. Installing on Red Hat Enterprise Linux and Fedora
      2. 1.4.2. Installing on Debian and Ubuntu
      3. 1.4.3. Installing on OpenSolaris
      4. 1.4.4. Installing from Source
      5. 1.4.5. Installing on Microsoft Windows
      6. 1.4.6. Installing on other Platforms
    5. 1.5. Configuring Puppet
      1. 1.5.1. The site.pp file
      2. 1.5.2. Firewall Configuration
      3. 1.5.3. Starting the Puppet Master
    6. 1.6. Connecting Our First Agent
      1. 1.6.1. Completing the Connection
    7. 1.7. Creating Our First Configuration
      1. 1.7.1. Extending the site.pp file
      2. 1.7.2. Agent Configuration
    8. 1.8. Creating our first module
      1. 1.8.1. Module Structure
      2. 1.8.2. The init.pp file
    9. 1.9. Applying Our First Configuration
    10. 1.10. Summary
    11. 1.11. Resources
  7. 2. Building Hosts with Puppet
    1. 2.1. Getting Started
      1. 2.1.1. Installing Puppet
      2. 2.1.2. Configuring Nodes
    2. 2.2. Making (More) Magic With Modules
      1. 2.2.1. Version Controlling Your Modules
    3. 2.3. Creating a module to Manage SSH
      1. 2.3.1. Managing Our Classes
    4. 2.4. Creating a Module to Manage Postfix
      1. 2.4.1. The postfix::install class
      2. 2.4.2. The postfix::config class
      3. 2.4.3. The postfix::service class
    5. 2.5. Managing MySQL with the mysql Module
      1. 2.5.1. The mysql::install class
      2. 2.5.2. The mysql::config class
      3. 2.5.3. The mysql::service class
    6. 2.6. Managing Apache and Websites
      1. 2.6.1. The apache::install class
      2. 2.6.2. The apache::service class
      3. 2.6.3. The Apache definition
    7. 2.7. Managing Puppet with the Puppet Module
    8. 2.8. Summary
    9. 2.9. Resources
  8. 3. Working with Environments
    1. 3.1. Configuring Puppet Environments
      1. 3.1.1. Populating the New Environments
      2. 3.1.2. Making Changes to the Development Environment
    2. 3.2. Testing the New Environments with the Puppet Agent
    3. 3.3. Environment Branching and Merging
      1. 3.3.1. Setting Up a Central Repository
      2. 3.3.2. Developing a Change Using a Branch
      3. 3.3.3. Merging Changes into a Testing Environment
    4. 3.4. Production Environment Releases
    5. 3.5. Summary
    6. 3.6. Resources
  9. 4. Puppet Scalability
    1. 4.1. Identifying the Challenges
    2. 4.2. Running the Puppet Master with Apache and Passenger
      1. 4.2.1. Installing Apache and Passenger on Enterprise Linux
      2. 4.2.2. Installing Apache and Passenger on Debian-Based Systems
      3. 4.2.3. Installing Passenger Using Ruby Gems
      4. 4.2.4. Configuring Apache and Passenger
      5. 4.2.5. Testing the Puppet Master in Apache
    3. 4.3. Load-Balancing Multiple Puppet Masters
      1. 4.3.1. HTTP Load Balancing
      2. 4.3.2. Puppet CA Load Balancing Configuration
    4. 4.4. Measuring Performance
      1. 4.4.1. Splay Time
    5. 4.5. Summary
    6. 4.6. Resources
  10. 5. Externalizing Puppet Configuration
    1. 5.1. External Node Classification
      1. 5.1.1. Configuring Nodes Using An External Node Classifier
      2. 5.1.2. An External Node Classifier in a Shell Script
      3. 5.1.3. A Ruby External Node Classifier
      4. 5.1.4. A Perl External Node Classifier
      5. 5.1.5. Back-Ending a Node Classification
    2. 5.2. Storing Node Configuration in LDAP
      1. 5.2.1. Installing Ruby LDAP Libraries
      2. 5.2.2. Setting Up the LDAP Server
      3. 5.2.3. Adding the Puppet Schema
      4. 5.2.4. Configuring LDAP in Puppet
    3. 5.3. Summary
    4. 5.4. Resources
  11. 6. Exporting and Storing Configuration
    1. 6.1. Virtual Resources
      1. 6.1.1. Declaring and Realizing a Virtual Resource
      2. 6.1.2. Applying the Realize Function
      3. 6.1.3. Making Virtual Resources Real
      4. 6.1.4. Relationship-Chaining Syntax
    2. 6.2. Getting Started with Exported and Stored Configurations
      1. 6.2.1. The Stored Configuration Database Server
      2. 6.2.2. Configuring Puppet Master for Stored Configuration
      3. 6.2.3. Adding a MySQL Table Index
    3. 6.3. Using Exported Resources
      1. 6.3.1. Automated SSH Public Host Key Management
      2. 6.3.2. Exporting Load Balancer Worker Resources
      3. 6.3.3. Automating Nagios Service Checks
    4. 6.4. Scaling Stored Configurations
      1. 6.4.1. Thin Stored Configurations
      2. 6.4.2. Queue Support for Stored Configurations
      3. 6.4.3. Installing ActiveMQ on Enterprise Linux-Based Systems
      4. 6.4.4. Installing ActiveMQ on Debian-Based Systems
      5. 6.4.5. Puppet Master Queue Configuration
    5. 6.5. Expiring Stale Resources
    6. 6.6. Summary
    7. 6.7. Resources
  12. 7. Puppet Consoles: Puppet Dashboard and The Foreman
    1. 7.1. Puppet Dashboard
      1. 7.1.1. Installing Puppet Dashboard
      2. 7.1.2. Configuring the Dashboard
      3. 7.1.3. Running Puppet Dashboard
      4. 7.1.4. Integrating Puppet Dashboard
      5. 7.1.5. External Node Classification
      6. 7.1.6. Logging, Database Backup and Performance
    2. 7.2. The Foreman
      1. 7.2.1. Installing Foreman
      2. 7.2.2. Configuring Foreman
      3. 7.2.3. Starting Foreman
      4. 7.2.4. Integrating Foreman's Capabilities
      5. 7.2.5. Displaying Reports in Foreman
      6. 7.2.6. Displaying Nodes Information in Foreman
      7. 7.2.7. Using Foreman to trigger Puppet
    3. 7.3. Summary
    4. 7.4. Resources
  13. 8. Tools and Integration
    1. 8.1. Puppet Forge and Module Tool
      1. 8.1.1. Installing the Puppet Module Tool
      2. 8.1.2. Searching and Installing a Module from the Forge
      3. 8.1.3. Using a Module
      4. 8.1.4. Creating a Module with the Puppet-Module Tool
    2. 8.2. Puppet Ruby DSL
      1. 8.2.1. The Problem: Resources from Data
      2. 8.2.2. Declaring Resources from Data
    3. 8.3. Cucumber Puppet
      1. 8.3.1. Installing Cucumber Puppet
      2. 8.3.2. Writing a Story
      3. 8.3.3. Testing the Basic Catalog Policy
      4. 8.3.4. Validating Specific Resources
    4. 8.4. Summary
    5. 8.5. Resources
  14. 9. Reporting with Puppet
    1. 9.1. Getting Started
    2. 9.2. Configuring Reporting
    3. 9.3. Report Processors
      1. 9.3.1. log
      2. 9.3.2. tagmail
      3. 9.3.3. rrdgraph
      4. 9.3.4. http
    4. 9.4. Custom Reporting
    5. 9.5. Summary
    6. 9.6. Resources
  15. 10. Extending Facter and Puppet
    1. 10.1. Writing and Distributing Custom Facts
      1. 10.1.1. Configuring Puppet for Custom Facts
      2. 10.1.2. Writing Custom Facts
      3. 10.1.3. Testing the Facts
    2. 10.2. Developing Custom Types, Providers and Functions
      1. 10.2.1. Configuring Puppet for Types, Providers and Functions
      2. 10.2.2. Writing a Puppet Type and Provider
      3. 10.2.3. Writing a Parsed File Type and Provider
      4. 10.2.4. A More Complex Type and Provider
      5. 10.2.5. Testing Types and Providers
      6. 10.2.6. Writing Custom Functions
    3. 10.3. Summary
    4. 10.4. Resources
  16. 11. Marionette Collective
    1. 11.1. Installing and Configuring RabbitMQ
      1. 11.1.1. Installing RabbitMQ on Debian
      2. 11.1.2. Installing RabbitMQ on RHEL / CentOS
      3. 11.1.3. RabbitMQ Configuration
      4. 11.1.4. Installing MCollective on Debian and Ubuntu
      5. 11.1.5. Installing MCollective on Enterprise Linux
      6. 11.1.6. MCollective Server Configuration
    2. 11.2. MCollective Plugins
      1. 11.2.1. Puppet Agent MCollective Plugins
      2. 11.2.2. The Facter Plugin for MCollective
      3. 11.2.3. Additional Plugins
    3. 11.3. Addressing Hosts with Metadata
    4. 11.4. Summary
    5. 11.5. Resources
  17. A. Working with Puppet
    1. A.1. Getting Support and Training
    2. A.2. Resources
      1. A.2.1. Web
      2. A.2.2. Mailing Lists
      3. A.2.3. Puppet Module Forge
      4. A.2.4. Puppet Enterprise
      5. A.2.5. Support (commercial)
      6. A.2.6. Training
      7. A.2.7. IRC
O'Reilly logo

Introduction

"ssh in a for loop is not a solution" – Luke Kanies, Puppet developer

The lives of system administrators and operations staff often revolve around a series of repetitive tasks: configuring hosts, creating users, and managing applications, daemons, and services. Often these tasks are repeated many times in the life cycle of one host, from building to decommissioning, and as new configuration is added or corrected for error or entropy.

The usual response to these repetitive tasks is to try to automate them with scripts and tools. This leads to the development of custom-built scripts and applications. In my first role as a systems administrator, I remember creating a collection of Control Language (CL) and Rexx scripts that I subsequently ...

The best content for your career. Discover unlimited learning on demand for around $1/day.