Summary
In this chapter, we examined how Puppet can handle data using the Hiera tool, reducing how much complexity would need to be put into code to represent a node, data center, organizational, OS, and other configuration differences. Hiera was shown to be a tool based on hierarchies of data that allowed us to access different files based on facts. It had built-in backends for data to be stored in YAML, JSON, HOCON, and EYAML files. The data structure was shown; we examined how values could be put into data files and how lookups can be performed; the types of merge were examined here as well as how special setups such as knockout
prefixes can be used in arrays.
We then showed how some custom backends can be used that have data types on different profiles; typically, these are specific integrations such as Vault or EYAML from the Forge, or in-house developed integrations to access data.
We then covered how Hiera worked over three layers – global, environment, and module...