Puppet 4.5 reference manual

Environments are isolated groups of Puppet agent nodes. A Puppet master server can serve each environment with completely different main manifests and modulepaths.

This frees you to use different versions of the same modules for different populations of nodes, which is useful for testing changes to your Puppet code before implementing them on production machines. (You could also do this by running a separate Puppet master for testing, but using environments is often easier.)

Assigning nodes to environments

You can assign agent nodes to environments using either the agent’s config file, or an external node classifier (ENC). If you are using Puppet Enterprise (PE), you can use the PE console to set environments.

For details, see the page on assigning nodes to environments.

Referencing the environment in manifests

In Puppet manifests, you can get the name of the current environment by using the $environment variable, which is set by the Puppet master.

About environments

You can add a new environment by simply adding a new directory of config data. To start using environments, do the following:

Unconfigured environments aren’t allowed

If a node is assigned to an environment which doesn’t exist — that is, there is no directory of that name in any of the environmentpath directories — the Puppet master fails compilation of its catalog.

Other information about environments

This section of the Puppet reference manual has several other pages about environments:

Back to top
The page rank or the 1 our of 5 rating a user has given the page.
The email address of the user submitting feedback.
The URL of the page being ranked/rated.