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)

Chapter 5. Custom Facts and Modules

We created and used modules up to this point when we installed and configured tuned using the is_virtual fact. We created a module called virtual in the process. Modules are nothing more than organizational tools, manifests, and plugin files that are grouped together.

We mentioned pluginsync in the previous chapter. By default, in Puppet 3.0 and higher, plugins in modules are synchronized from the master to the nodes. Plugins are special directories in modules that contain Ruby code.

Plugins are contained within the /lib subdirectory of a module, and there can be four possible subdirectories defined: files, manifests, templates, and lib. The manifests directory holds our manifests, as we know files has our files, templates has the templates, and lib is where we extend Augeas, Hiera, Facter, and/or Puppet depending on the files we place there.

Note

You may also see a spec directory in modules downloaded from Puppet Forge. This directory holds the files used...