|
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.
|