|
From the customer point of view, we need consistency. If lookup uses the classifier to retrieve the environment for pinned nodes, then it should also look at the classifier for nodes matched via a rule, regardless of the rule.
As I see it, the options would be: 1. Always use the classifier to determine environment. 2. Always use production.
I think option 1 allows the user to have a tool to troubleshoot hiera if things go wrong and allows lookup to behave as close as the puppet run as possible.
Now we're stuck in a state that is in between those 2 options: sometimes we get real environment, sometimes we get production. That is what this ticket is trying to address.
Last but not least, users come from using hiera, and hiera could give a reasonably accurate answer only from the master, so I'm not opposed to the idea of the master being able to retrieve the real environment but the agents using production if the classifier cannot be reached.
That being said, I'd also like to see lookup accept a --environment flag to override the default, since right now that flag only works if the node is in the "agent-specified" node group, but I believe that's being covered in another ticket.
|