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)

Design pattern


The concept put forth by Craig Dunn in his blog is the one at which most Puppet masters arrive independently. Modules should be nested in such a way that common components can be shared among nodes. The naming convention that is generally accepted is that roles contain one or more profiles. Profiles in turn contain one or more modules. You can have a node-level logic that is very clean and elegant using the roles and profile design patterns, together with an ENC and Hiera,. The ENC and/or Hiera can also be used to enforce standards on your nodes without interfering with the roles and profiles. As we discussed in Chapter 2, Organizing Your Nodes and Data, with the virtual module it is possible to have Hiera apply classes automatically to any system where the is_virtual fact is true. Applying the same logic to facts such as osfamily, we can ensure that all the nodes for which osfamily is RedHat, receive an appropriate module.

Putting all these elements together, we arrive at...