Old debugging techniques

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

Get Mastering Puppet 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.