Directories: The Main Manifest(s)

This version of Puppet is not included in Puppet Enterprise. The latest version of PE includes Puppet 4.10. A newer version is available; see the version menu above for details.

Puppet always starts compiling with either a single manifest file or a directory of manifests that get treated like a single file. This main starting point is called the main manifest or site manifest.

For more information on how the site manifest is used in catalog compilation, see the reference page on catalog compilation.

Location

With Puppet Master

The main manifest may be a single file or a directory of .pp files. To check the actual manifest your puppet master will use, run puppet config print manifest --section master --environment <ENVIRONMENT>.

Recommended: If you’re using the main manifest heavily instead of relying on an ENC, consider changing the manifest setting to $confdir/manifests. This lets you split up your top-level code into multiple files while avoiding the import keyword. It will also match the behavior of simple environments.

Bug warning: PUP-1944 — In Puppet 3.5.0-rc1, the puppet master will malfunction if the value of the manifest setting is a directory but doesn’t exactly match the (otherwise unused) manifestdir setting.

With Puppet Apply

The puppet apply command requires a manifest as an argument on the command line. (For example: puppet apply /etc/puppetlabs/puppet/manifests/site.pp.) It may be a single file or a directory of files.

Puppet apply does not use the manifest setting or environment-specific manifests; it always uses the manifest given on the CLI.

Directory Behavior (vs. Single File)

If the main manifest is a directory, Puppet will parse every .pp file in the directory in alphabetical order and then evaluate the combined manifest.

Puppet will act as though the whole directory were just one big manifest; for example, a variable assigned in the file 01_all_nodes.pp would be accessible in node_web01.pp.

Puppet will only read the first level of files in a manifest directory; it won’t descend into subdirectories.

↑ Back to top