Configuring a hierarchy level: general format
Hiera supports custom backends.
Each hierarchy level is represented by a hash which needs the following keys:
name— A name for this level, shown in debug messages and--explainoutput.- A backend key, which must be one of:
data_hashlookup_keydata_dig— a more specialized form oflookup_key, suitable when the backend is for a database.data_digresolves dot separated keys, whereaslookup_keydoes not.hiera3_backend(global layer only)
- A path or URI key — only if required by the backend. These
keys support variable interpolation. The following path/URI keys are
available:
pathpathsmapped_pathsglobglobsuriuris- these paths or URIs work the same way they do for the built-in backends. Hiera handles the work of locating files, so any backend that supportspathautomatically supportspaths,glob, andglobs.uri(string) anduris(array) can represent any kind of data source. Hiera does not ensure URIs are resolvable before calling the backend, and does not need to understand any given URI schema. A backend can omit the path/URI key, and rely wholly on theoptionskey to locate its data.
datadir— The directory where data files are kept: the path is relative to hiera.yaml's directory. Only required if the backend uses thepath(s)andglob(s)keys, and can be omitted if you set a default.options— A hash of extra options for the backend; for example, database credentials or the location of a decryption key. All values in theoptionshash support variable interpolation.
Whichever key you use, the value must be the name of a function that implements the backend API. Note that the choice here is made by the implementer of the particular backend, not the user.
For more information, see custom Puppet function.
Related information