Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
PUP 4.9.4
-
None
-
-
Night's Watch
-
5
-
NW - 2021-11-17, NW - 2021-12-06
-
Major
-
3 - 25-50% of Customers
-
3 - Serious
-
5 - $$$$$$
-
-
Enhancement
-
Changed the priority of the `--environment` option by skipping the classification whenever the flag is specified. This allows the user to bypass the ENC enforced environment with the CLI option.
-
Automate
-
could be automated in an integration test in rspec
Description
The use case here is that we're trying to move people away from using the hiera binary to simulate/debug lookups to using puppet lookup. With hiera you could pass environment variables that matched whatever "variables" were in hiera.yaml to simulate what Puppet would provide, so doing: hiera testkey environment=test would allow us to simulate this lookup in the test environment.
When we tried doing that with: puppet lookup testkey – environment test we found that we were still getting values from the production environment. This is because puppet lookup (even without using --compile) will pull down a node object for whatever node is being targeted, and that means it's going through paths of indirection and ultimately the ENC. If the ENC is enforcing an environment, then puppet lookup is bound to that environment. In our case above (using the Console), setting the node to a nodegroup enforcing "Agent-specified environment" allowed us to simulate a lookup in another environment properly.
I'm marking this as an "Improvement" instead of a bug, but the reality is that it's a pretty major use-ability issue because being able to simulate lookups decoupled from the ENC is a pretty common exercise for people debugging Hiera data.
Attachments
Issue Links
- is blocked by
-
PUP-8094 Lookup ignores environment from the classifier when using rule with trusted facts
-
- Resolved
-