Environment resources

An environment specifies resources that the primary server uses when compiling catalogs for agent nodes. The modulepath, the main manifest, Hiera data, and the config version script, can all be specified in environment.conf.

The modulepath

The modulepath is the list of directories Puppet loads modules from. By default, Puppet loads modules first from the environment’s directory, and second from the primary server's puppet.conf file’s basemodulepath setting, which can be multiple directories. If the modules directory is empty or absent, Puppet only uses modules from directories in the basemodulepath.

Related topics: module path.

The main manifest

The main manifest is the starting point for compiling a catalog. Unless you say otherwise in environment.conf, an environment uses the global default_manifest setting to determine its main manifest. The value of this setting can be an absolute path to a manifest that all environments share, or a relative path to a file or directory inside each environment.

The default value of default_manifest is ./manifests — the environment’s own manifests directory. If the file or directory specified by default_manifest is empty or absent, Puppet does not fall back to any other manifest. Instead, it behaves as if it is using a blank main manifest. If you specify a value for this setting, the global manifest setting from puppet.conf is not be used by an environment.

Related topics: main manifest,environment.conf,default_manifest setting, puppet.conf.

Hiera data

Each environment can use its own Hiera hierarchy and provide its own data.

Related topics: Hiera config file syntax.

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. By default, the config version is the time at which the catalog was compiled (as the number of seconds since January 1, 1970).

The environment.conf file

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

The environment.conf file overrides these settings:

  • modulepath
  • manifest
  • config_version
  • environment_timeout

Related topics: environment.conf