Puppet Version: 6.25.1 Puppet Server Version: PE 2019.8.9 OS Name/Version: CentOS 7 Desired Behavior: puppet lookup on shell is working Actual Behavior: At a client I was replacing legacy facts and global variables in the hiera.yaml where this was possible. The client still uses a centralized hiera.yaml, instead of a hiera.yaml per environment. The hiera.yaml includes a reference to the environment in the datadir:
version: 5 |
defaults: |
datadir: /etc/puppetlabs/code/%{::environment}/modules/hiera |
This is working fine. Also with puppet lookup and --compile parameter on the commandline. Changing this to:
version: 5 |
defaults: |
datadir: /etc/puppetlabs/code/%{server_facts.environment}/modules/hiera |
has a different outcome: puppetserver still working fine. puppet lookup with --compile on the commandline throwing issue value for parameter not found. After reverting the change it's fine again. The manpage describes server_facts should be resolvable: https://puppet.com/docs/puppet/7/man/lookup.html#options |