Book Image

Troubleshooting Puppet

By : Thomas Uphill
Book Image

Troubleshooting Puppet

By: Thomas Uphill

Overview of this book

Table of Contents (14 chapters)

Chapter 3. Modules and Templates

As a Puppet developer or a system administrator, modules are how you deliver your code to the nodes. Modules are great for organizing your code into manageable chunks, but modules are also where you'll see most of your problems when troubleshooting. In this chapter, we will look at how the various parts of a module may cause issues. Most modules contain classes in a manifests directory, but modules can also include custom facts, functions, types, providers, as well as files and templates. Each of these components can be a source of error. We will address each of these components in the following sections, starting with classes.

In Puppet, the namespace of classes is referred to as the scope. Classes can have multiple nested levels of subclasses. Each class and subclass defines a scope. Each scope is separate. To refer to variables in a different scope, you must refer to the fully scoped variable name. For instance, in the following example, we have a class...