Managing modules with a Puppetfile
Almost all Puppet manifests are kept in modules, which are collections of Puppet code and data that have a specific directory structure. With Puppet Enterprise (PE) code management, you only use the Puppetfile to install and manage modules.
To learn more about modules in general, refer to the Modules overview in the Puppet documentation.
By default, Code Manager and r10k
install module content in a modules
directory in the same
directory the Puppetfile is in. For example, with the
default settings, declaring the puppetlabs-apache
module in your Puppetfile installs the apache
module into the ./modules/apache
directory. However,
you can Change the module installation directory.
module
directory that is not listed in your Puppetfile. For this reason, if you use Code Manager or r10k, you must
not use the puppet module
command to install or manage modules.
Instead, you must declare modules in each environment's Puppetfile. Code management uses the Puppetfile to install, update, and manage your modules. If
you use puppet module install
to install a module to the
live code directory, code management deletes the module when it is not found in the Puppetfile.Declaring your own modules
If you develop your own modules that you maintain in source control, you can declare them in your Puppetfile, just like you would declare any module from a Git repository. If your modules aren't maintained in source control, you'll need to move them to source control so you can declare then in your Puppetfile and allow code management to install and manage your module in your environments.
Related information
Deploying module code
When you change your Puppetfile to install or update a module (or when you update a module that you wrote that you've declared in your Puppetfile), you must trigger Code Manager or r10k to deploy the new or updated code to your environments.
spec
directories. These directories are for
testing only, and they are not useful in a production environment. If you want to deploy
a module's spec
directory, add exclude_spec: false
to the module declaration in your Puppetfile.Related information