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.
With Puppet Master
- When using no environments, the main manifest will default to
$confdir/manifests/site.pp, which is a single file. (See here for info about the confdir.) This location can be configured with the
- If you are using directory environments, the main manifest will always be
$confdir/environments/<ENVIRONMENT NAME>/manifests, which is a directory. The location of the environments directory can be configured with the
environmentpathsetting; see the page about directory environments for more details.
- If you are using config file environments, Puppet will look for a
manifestsetting in that environment’s config section; if it isn’t set there, Puppet will fall back to the
manifestsetting in the
[main]section. See the page about config file environments for more details.
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
$confdir/manifests. This lets you split up your top-level code into multiple files while avoiding the
importkeyword. 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
manifestsetting is a directory but doesn’t exactly match the (otherwise unused)
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
Puppet will only read the first level of files in a manifest directory; it won’t descend into subdirectories.