Pitfalls, gotchas, and issues
When working in large datasets with multiple levels and layers, it can become complicated to understand why certain answers have been generated or where errors have been inserted. This section will focus on approaches to understanding and debugging data lookups and tools that can make the data more visible.
Hiera problems tend to fall into a few categories: syntax, formatting, backend communication and performance issues, hierarchy ordering mistakes, and many others.
The puppet lookup
command is the best way to test Hiera data and is, in effect, like the lookup
function used in Puppet code. Using this on the primary server, the basic syntax of this command is puppet lookup <key> --node <node_name> --
environment <environment_name>
.
This command will return the value, if found, or nothing. It is important to understand the effect of the various flags available to the command to return more detailed information. A common mistake...