Puppet Function: dovecot::create_extconfigfile_resources
- Defined in:
- functions/create_extconfigfile_resources.pp
- Function type:
- Puppet Language
Summary
create {dovecot::extconfigfile} resources from a nested hash (e.g. from hiera)Overview
Function: dovecot::create_extconfigfile_resources()
Create dovecotdovecot::extconfigfile resources from a nested hash, suitable for conveniently loading values from hiera.
The first level of keys is the config files to be written to, the values being the hierarchical values that will be passed to the extconfigfile resource.
Values can either be a Hash[String, String], or a hash containing two properties ‘entries` and `additional_content`.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'functions/create_extconfigfile_resources.pp', line 22
function dovecot::create_extconfigfile_resources(
Hash[String, Hash] $configfile_hash,
) {
$dovecot::extconfigs.each|$key, $value| {
case $value {
Hash[String, String]: {
$_entries = $value
$_additional_content = undef
}
Struct[{
entries => Hash[String, String],
Optional[additional_content] => Optional[String],
}]: {
$_entries = $value[entries]
$_additional_content = $value[additional_content]
}
default: { fail("Unsupported value type for extconfigfile: ${value}") }
}
dovecot::extconfigfile { $key:
entries => $_entries,
additional_content => $_additional_content,
relpath => $key,
}
}
}
|