Understanding Puppet Modules

A Puppet module can be thought of as a self-contained bundle of code that implements a related set of functionality. Developers write custom modules and combine these with pre-built modules from the Puppet Labs repository, Puppet Forge. Modules are how Puppet finds the classes and types it can use — it automatically loads any class, defined type, or custom types stored in its modules. A module can be thought of as being somewhat like an EAR file in the sense that it is a container or archive that stores a self-contained archive of functionality. A Puppet module contains some of the following:

  • Puppet source files — manifests with the .pp extension, which implement the functionality exhibited by the module

  • Test manifests that allow your module to be tested in an isolated fashion

  • Library of types and providers

  • Template files into which custom values may be substituted

  • Metadata file that describes the version and purpose of the modules