Puppet Function: dovecot::create_config_file_resources

Defined in:
functions/create_config_file_resources.pp
Function type:
Puppet Language

Summary

create {dovecot::config} resources from a nested hash (e.g. from hiera)

Overview

dovecot::create_config_file_resources(Hash[String, Hash] $configfile_hash, Boolean $include_in_main_config = true, Hash $params = {})Any

Function: dovecot::create_config_file_resources()

Create dovecotdovecot::config 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 create_config_resources function

Parameters:

  • configfile_hash (Hash[String, Hash])

    a hash of config file names mapped to config hashes

  • include_in_main_config (Boolean) (defaults to: true)

    whether the single config files should be included from dovecot.conf

  • params (Hash) (defaults to: {})

    a hash of params passed to the dovecotdovecot::config resource (:file will be overridden)

Returns:

  • (Any)

See Also:

Author:

  • Bernhard Frauendienst <puppet@nospam.obeliks.de>



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'functions/create_config_file_resources.pp', line 22

function dovecot::create_config_file_resources(
  Hash[String, Hash] $configfile_hash,
  Boolean $include_in_main_config = true,
  Hash $params = {}
) {
  $configfile_hash.each |$key, $value| {
    $file_params = { file => $key } + $params
    dovecot::create_config_resources($value, $file_params)
    if $include_in_main_config {
      dovecot::config { "dovecot.conf !include ${key} ${value}":
        key   => '!include',
        value => "conf.d/${key}.conf",
      }
    }
  }
}