Learning Kit

Puppet Language Basics

Modules

Time: 5 minutes
Materials needed: none

Puppet manifests are organized, stored, and distributed using Modules. Modules are used to manage a specific task or application, such as installing or configuring a piece of software. They are how Puppet finds classes and types it can use.

module-name/
     | - manifests
     | - init.pp
     | - files
     | - templates
     | - tests
     | - spec
     | - metadata.json

A module is simply a directory tree, containing manifests and other files. This directory structure allows nodes to discover and load classes, resource types, facts, and more. The module’s name is the name of the top directory.

If a class is defined in a module, you can declare that class by name in any manifest. When the Puppet master compiles the catalog, it will dynamically load the manifest that contains the class definition, making all classes and resources inside available for use across your system.

There are thousands of modules available for download at the Puppet Forge, written by Puppet developers and community members. Supported modules have not only been tested to work with Puppet Enterprise, they are also included in Enterprise support and are compatible with multiple platforms. Exploring modules on the Forge is a great way to learn more about modules and what they can accomplish.

Puppet sites use proprietary and third-party cookies. By using our sites, you agree to our cookie policy.