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 apply
puppet apply command requires a manifest as an argument on the command line. (For example:
puppet apply /etc/puppetlabs/code/environments/production/manifests/site.pp.) It can be a single file or a directory of files.
puppet apply command does not automatically use an environment’s manifest. Instead, it always uses the manifest you pass to it.
With Puppet master
Puppet master always uses the main manifest set by the current node’s environment. The main manifest can be a single file or a directory of
By default, the main manifest for a given environment is
<ENVIRONMENTS DIRECTORY>/<ENVIRONMENT>/manifests. (For example:
/etc/puppetlabs/code/environments/production/manifests.) You can configure the manifest per-environment, and you can also configure the default for all environments.
- An environment can use the
manifestsetting in environment.conf to choose its main manifest. This can be an absolute path or a path relative to the environment’s main directory. If absent, it defaults to the value of the
default_manifestsetting from puppet.conf.
default_manifestsetting defaults to
./manifests. Like the
manifestsetting, the value of
default_manifestcan be an absolute path or a path relative to the environment’s main directory.
- You can also force all environments to use the
default_manifest(ignoring their own
manifestsettings) by setting
disable_per_environment_manifest = truein puppet.conf.
For more details, see:
To check the manifest your Puppet master will use for a given environment, run
puppet config print manifest --section master --environment <ENVIRONMENT>.
Directory behavior (vs. single file)
If the main manifest is a directory, Puppet parses every
.pp file in the directory in alphabetical order and evaluate the combined manifest. It descends into all subdirectories of the manifest directory and loads files in depth-first order. (For example, if the manifest directory contains a directory named
01 and a file named
02.pp, it will parse all the files in
Puppet acts 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