Hi all,
For a set of Puppet modules which are tightly coupled to hiera, I'm trying to figure out a way to decouple from hiera and provide a suitable way to supply a set of default parameters. A sample class (non-refactored) is shown at [1].
One possible option I though of using is the params class model, which uses a params class to include the default mandatory parameters. By default, the hiera lookups can be commented out so that the default parameters in params class is picked. I referred the ntp puppet module as a reference [2].
wdyt of this method? What would be a cleaner approach?
Thank you!
[1].
#
class foo inherits base {
$foo1 = hiera('foo1param')
$foo2 = hiera('foo2param')
# other logic
}
[2]. https://github.com/puppetlabs/puppetlabs-ntp/blob/master/manifests/init.pp
↧