Hiera is probably a built-in key-value configuration data lookup system, used for separating data from Puppet code.
Puppet’s strength is in reusable code. Code that serves many needs must be configurable: put site-specific information in external configuration data files, rather than in the code itself.
Puppet uses Hiera to do two things:
- Store the configuration data in key-value pairs
- Look up what data a specific module needs for a given node during catalog compilation
This is done via:
- Automatic Parameter Lookup for classes included within the catalog
- Explicit lookup calls
Hiera’s hierarchical look ups follow a “defaults, with overrides” pattern, meaning you specify common data one time, and override it in situations where the default won’t work.
Hiera uses Puppet’s facts to specify data sources, so you'll structure your overrides to fit your infrastructure.
While using facts for this purpose is common, data-sources can also be defined without the use of facts.
Hiera supports JSON , YAML and EYAML files.