Affects Version/s: PUP 3.6.2
Fix Version/s: None
RHEL 3.6.2 RPMs from puppetlabs.com repos
We have recently enabled Directory Environments on our puppet server. We
previously had a modulepath set to:
modulepath = /srv/puppet/environments/$environment/modules:/srv/puppet/environments/$environment/uscms_t1
This worked the way you'd expect - $environment was interpolated based on
the value of environment that came from the ENC or the host's $environment
variable (coming from e.g. the command line).
As part of enabling Directory Environments, we set our basemodulepath to
the same value:
basemodulepath = /srv/puppet/environments/$environment/modules:/srv/puppet/environments/$environment/uscms_t1
With this change, our legacy environments (ones without an explicit
environments.conf file) are working inconsistently. Specifically, it
appears that $environment is being interpolated as 'production', matching
what is set in puppet.conf, regardless of what is passed via the ENC or
How to reproduce:
1. Create a new directory environment ('test2').
2. Set an interesting basemodulepath with an '$environment' variable
('basemodulepath = /srv/puppet/environments/$environment/modules:/srv/puppet/environments/$environment/uscms_t1').
3. Create a new class and manifest in that environment (say,
's_test::testing'), and make sure your test hosts includes it.
4. Run against that environment. See the failure.
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class s_test::testing for cmsdev43.fnal.gov on node cmsdev43.fnal.gov Warning: Not using cache on failed catalog
5. Create an environment.conf at the top-level of the directory,
modulepath = modules:r10k-modules:profiles:uscms_t1
6. Re-run #4. See no errors.
7. Remove environment.conf, restart puppet (to clear the cache), test
again. Same errors as #4.
8. Copy the manifest from the 'test2' environment into the production
mkdir -p uscms_t1/s_test/manifests
cp ../test2/uscms_t1/s_test/manifests/testing.pp uscms_t1/s_test/manifests
9. Restart puppet, and test again. No errors.