Previously, we have run hiera from the command line with the –debug argument, and provided the setting, for example, mysetting, we would like to look up, as follows:
$ hiera -c /etc/puppetlabs/puppet/hiera.yaml --debug mysetting
The preceding command runs hiera in the debug verbosity necessary, but we also need to collect the node's facts and other relevant information (particularly the environment and fqdn):
$ hiera -c /etc/puppetlabs/puppet/hiera.yaml --debug --json facts.json mysetting environment=production fqdn=mynode.example.local
Another earlier debugging method was to use the hiera lookup function inside puppet apply using the -e (execute) argument:
$ puppet apply --debug -e '$foo = hiera(mysetting) notify { $foo: }'