What is Hiera?
So far, we have discussed how using Puppet creates stateful and reusable code and how, by using the roles and profiles method, parameters can be made available to make modules configurable. We also showed how to use those parameters in code, but to create a scalable, readable, and site-specific data source, Puppet uses a tool called Hiera. Without using Hiera data in Puppet code, it would require endless logic and variables to represent data variations required for node exceptions, location differences, OS version variations, organization differences, and many other circumstances.
Hiera is a data lookup tool that looks up values in files of JSON, HOCON, YAML, and EYAML, the built-in backends, or using custom backends that can call external sources such as websites or databases. It stores data in key-value pairs that can be looked up either explicitly via a function call in code or automatically using the automatic parameter lookup, which matches parameter names from...