Modules are self-contained, shareable bundles of code and data. Each module manages a
specific task in your infrastructure, such as installing and configuring a piece of software.
With Puppet Enterprise (PE), a lot of your infrastructure is supported by
modules, so it is important to learn how to install, build, and use them. To practice working
with modules, try installing the
puppetlabs/apache module, which automates
installing, configuring, and managing Apache
- Go to the Apache module page on the Forge.
Select r10k or Code Manager as the Installation
Method, and follow the instructions to add the module declaration to
By default, Code Manager installs the latest version and disables automatic updates; however, you can specify options to install a different version or keep the module current with the latest version. To automatically update the module when a new version is released, specify
mod 'puppetlabs/apache', :latest). To install a specific version of the module and prevent automatic updates, specify the version number as a string (such as
mod 'puppetlabs/apache', '5.4.0').
Make sure your Puppetfile includes module
declarations for the
puppetlabs/concatmodules, which are dependencies of the
apachemodule. Dependencies for each module are listed on the Dependencies tab on the module’s Forge page, and you can specify the desired version in the same way you did for the primary module.For example, this code installs version 5.4.0 of the
apachemodule, installs the module's dependencies, and prevents automatic updates (due to specified version numbers):
mod 'puppetlabs/apache', '5.4.0' mod 'puppetlabs/stdlib', '4.13.1' mod 'puppetlabs/concat', '2.2.1'
SSH into your primary server and run
puppet-code deploy --allto deploy code.
apachemodule. Installing a module makes it available in PE so you can use it to manage nodes.
After installing a module, you can run tasks included in the module from the PE console. The
apache module contains a
task that allows you to perform Apache
service functions. To view or run the
apache task in the PE console, go to the Run section,
under Task, and enter apache in the
apache task doesn't appear, try refreshing the console in the
browser. If it still does not appear, check that the
module is in your Puppetfile and try again.
To continue managing Apache configuration on *nix targets, Set up Apache node groups.