Book Image

Mastering Puppet - Second Edition

By : Thomas Uphill
Book Image

Mastering Puppet - Second Edition

By: Thomas Uphill

Overview of this book

Puppet is a configuration management system and a language. It was written for and by system administrators to manage large numbers of systems efficiently and prevent configuration drifts. Mastering Puppet deals with the issues faced when scaling out Puppet to handle large numbers of nodes. It will show you how to fit Puppet into your enterprise and allow many developers to work on your Puppet code simultaneously. In addition, you will learn to write custom facts and roll your own modules to solve problems. Next, popular options for performing reporting and orchestration tasks will be introduced in this book. Moving over to troubleshooting techniques, which will be very useful. The concepts presented are useful to any size organization. By the end of the book, you will know how to deal with problems of scale and exceptions in your code, automate workflows, and support multiple developers working simultaneously.
Table of Contents (17 chapters)

Hiera


Hiera allows you to create a hierarchy of node information. Using Hiera, you can separate your variables and data from your modules. You start by defining what that hierarchy will be, by ordering lookups in the main configuration file, hiera.yaml. The hierarchy is based on facts. Any fact can be used, even your own custom facts may be used. The values of the facts are then used as values for the YAML files stored in a directory, usually called hieradata. More information on Hiera can be found on the Puppet Labs website at http://docs.puppetlabs.com/hiera/latest.

Tip

Facts are case sensitive in Hiera and templates. This could be important when writing your hiera.yaml script.

Configuring Hiera

Hiera only needs to be installed on your Puppet master nodes. Using the Puppet Labs repo, Hiera is installed by the puppet-agent package. Our installation pulled down puppet-agent-1.2.2-1.el7.x86_64, which installs Hiera version 3.0.1, as shown here:

[thomas@stand ~]$ hiera --version
3.0.1

Previous...