Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Duplicate
-
PUP 6.27.0
-
None
-
None
-
Phoenix
-
Customer Feedback
-
49053
-
1
-
Needs Assessment
Description
Puppet Version: 6.27.0 / 7.16.0
Puppet Server Version: 2019.8.11 / 2021.6.0
OS Name/Version: RHEL 8
We've a hiera.yaml that uses topscope facts within paths, like data/%{::tier}.yaml. With PE 2019.8.9, this worked fine. In https://tickets.puppetlabs.com/browse/PUP-7479 puppet lookup was broke due to a regression (and released in PE 2019.8.10). This was fixed in parts in https://tickets.puppetlabs.com/browse/PUP-11437 (and released in PE 2019.8.11).
I also placed a comment in https://tickets.puppetlabs.com/browse/PUP-11437 and a slack thread at https://puppetcommunity.slack.com/archives/C19V5U41Z/p1658312927398119
Desired Behavior:
puppet lookup --node $(hostname -f) --compile --environment $hiera_key should work as expected.
Actual Behavior:
puppet lookup fails to resolve the variable. When hiera.yaml uses data/%{::tier}.yaml, puppet lookup will look into data/.yaml.
I raised a PE support ticket for this. jarret.lavallee suggested this patch (on the 6.27.0 git tag):
diff --git a/lib/puppet/application/lookup.rb b/lib/puppet/application/lookup.rb
|
index b9e6f22c87..cc6affcb9e 100644
|
--- a/lib/puppet/application/lookup.rb
|
+++ b/lib/puppet/application/lookup.rb
|
@@ -376,7 +376,7 @@ Copyright (c) 2015 Puppet Inc., LLC Licensed under the Apache 2.0 License
|
facts = retrieve_node_facts(node, given_facts)
|
ni = Puppet::Node.indirection
|
tc = ni.terminus_class
|
- if options[:compile] && !Puppet.settings.set_by_cli?('environment')
|
+ if options[:compile]
|
if tc == :plain
|
node = ni.find(node, facts: facts)
|
else
|
I restarted all PE services and did a few agent runs. I can confirm that this fixes the problem, but I don't know if this causes any side effects (that's why I didn't provide this change as a PR).
Attachments
Issue Links
- duplicates
-
PUP-11527 puppet lookup -E doesn't execute the ENC
-
- Resolved
-
- is duplicated by
-
PUP-11504 puppet lookup fails with server_facts in hiera.yaml
-
- Closed
-
- relates to
-
PUP-11437 puppet lookup fails to interpolate topscope variables when an environment is specified
-
- Resolved
-
-
PUP-7479 ENC-enforced environment makes `puppet lookup` environment simulation difficult
-
- Resolved
-
-
DOCUMENT-1355 PE 2019/2021 known issues: PUP-11595 is missing
-
- Resolved
-