¶ ↑
credativ slapd puppet module¶ ↑
RequirementsThis module template requires the params_lookup function as found in the example42 puppi module (github.com/credativ/puppet-example42lib)
¶ ↑
UsageThis module template uses parameterized classes. However, to make it work well with ENCs and to support hiera as an external data store, it uses a special function to define defaults for each parameter. That way, there are several ways to feed parameters into classes created with this module.
¶ ↑
Top-Level variables / HieraIn this case the argument name in the class needs to be prefixed with the module name. For example, if a module has a parameter use_xy it can be pre-declared like this:
$modulename_use_xy = $value
The same naming scheme works if parameters are defined in hiera.
Just be aware of global parameters: Modules may declare a parameter as global. In this case it is not prefixed with the module name. That usually makes sense for variables which are shared between various different modules.
¶ ↑
ParametersObviously passing the plain parameters as argument to the class definition works too:
class { 'modulename': use_xy => $value }
In that case no prefixing with the module name is required.
¶ ↑
DefaultsIf no value is specified, in none of the mentioned data sources, modules refer to default values. Those are defined in modulename::params (manifests/params.pp). Each module shall define the most sensible defaults.