The Modulepath

The Default Modulepath

By default, the effective modulepath for a given environment will be:

<MODULES DIRECTORY FROM ENVIRONMENT>:$basemodulepath

That is, Puppet will add the environment’s modules directory to the value of the basemodulepath setting from puppet.conf, with the environment’s modules getting priority. If the modules directory is empty or absent, Puppet will only use modules from directories in the basemodulepath.

Configuring the Modulepath

You can configure a different modulepath for an environment by setting modulepath in its environment.conf file. Note that the global modulepath setting from puppet.conf will never be used by an environment.

Note: In Puppet Enterprise, every environment must include /opt/puppetlabs/puppet/modules in its modulepath, since PE uses modules in that directory to configure its own infrastructure.

Environments already get this directory by default, since it’s part of the default value of basemodulepath. Don’t remove it from the basemodulepath setting, and if you override the modulepath in environment.conf, ensure your custom modulepath includes either $basemodulepath or /opt/puppetlabs/puppet/modules.

The Default Main Manifest

The value of this setting can be an absolute path to a manifest that all environments will share, or a relative path to a file or directory inside each environment.

The default value of default_manifest is ./manifests — that is, the environment’s own manifests directory.

If the file or directory specified by default_manifest is empty or absent, Puppet will not fall back to any other manifest; instead, it will behave as though you used a totally blank main manifest. Note that the global manifest setting from puppet.conf will never be used by an environment.

Configuring the Main Manifest

You can configure a different main manifest for an environment by setting manifest in its environment.conf file.

As with the global default_manifest setting, you can specify a relative path (to be resolved within the environment’s directory) or an absolute path.

The Config Version Script

Puppet automatically adds a config version to every catalog it compiles, as well as to messages in reports. The version is an arbitrary piece of data that can be used to identify catalogs and events.

The Default Config Version

By default, the config version will be the time at which the catalog was compiled (as the number of seconds since January 1, 1970).

Configuring the Config Version

You can specify an executable script that will determine an environment’s config version by setting config_version in its environment.conf file. Puppet will run this script when compiling a catalog for a node in the environment, and use its output as the config version. Note that the global config_version setting from puppet.conf will never be used by an environment.

Note: If you’re using a system binary like git rev-parse, make sure to specify the absolute path to it! If config_version is set to a relative path, Puppet will look for the binary in the environment, not in the system’s PATH.

The environment.conf File

An environment can contain an environment.conf file, which can override values for certain settings.

In this version of Puppet, the environment.conf file is only allowed to override five settings: