HomePhorge

(PUP-2213) Read environment settings from other sections in config print
016f5f0b67c4Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(PUP-2213) Read environment settings from other sections in config print

Puppet's config print functionality has a --section option to allow you
to read the configuration as it would be seen in other run modes such as
master or agent. But the environment loaders are provided an
environmentpath and basemodulepath setting prior to Puppet evaluating
the user's --section setting, and will only provide environments as
configured in [main]. So if you have environmentpath set in master, a
`puppet config print modulepath --section master --environment
production` would show you the modulepath for the production
environment as loaded from [main] not [master].

To fix this, when handling a config print call, we are now overriding
the environment loaders with settings obtained from the user selected
section. This means that the interpolated settings can now find an
environment from an environmentpath specified in any section of
puppet.conf.

The static environment loader get_conf() method is also changed to
return a simple configuration that just returns the statically declared
environment's settings. This ensures that `puppet config print
--environment doesnotexist` will correctly print the 'no_manifest' and
empty modulepath setting that reflect the private statically configured
environment settings for a non-existent directory environment.

Details

Provenance
Josh Partlow <joshua.partlow@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUc811a16a192a: (maint) Quote % in hiera.conf for dynamic environments acceptance
Branches
Unknown
Tags
Unknown

Event Timeline

Josh Partlow <joshua.partlow@puppetlabs.com> committed rPU016f5f0b67c4: (PUP-2213) Read environment settings from other sections in config print (authored by Josh Partlow <joshua.partlow@puppetlabs.com>).Apr 19 2014, 1:33 AM