Updated classic Hiera function calls
The hiera
, hiera_array
, hiera_hash
, and hiera_include
functions are all deprecated. The lookup
function is a complete replacement for all of
these.
Hiera function | Equivalent lookup call |
---|---|
hiera('secure_server')
|
lookup('secure_server')
|
hiera_array('ntp::servers')
|
lookup('ntp::servers', {merge =>
unique})
|
hiera_hash('users')
|
lookup('users', {merge => hash}) or
lookup('users', {merge =>
deep}) |
hiera_include('classes')
|
lookup('classes', {merge =>
unique}).include
|
To prepare for deprecations in future Puppet versions, it's best
to revise your Puppet modules to replace the
hiera_*
functions with lookup
. However, you
can adopt all of Hiera 5's new features in other modules without updating these
function calls. While you're revising, consider refactoring code to use automatic
class parameter lookup instead of manual lookup calls. Because automatic lookups can
now do unique and hash merges, the use of manual lookup in the form of
hiera_array
and hiera_hash
are not as
important as they used to be. Instead of changing those manual Hiera calls to be calls to the
lookup
function, use Automatic Parameter Lookup (API).
Related information