Defined Type: dovecot::configfile

Defined in:
manifests/configfile.pp

Summary

Manages a single dovecot config file

Overview

Note:

This define is only for internal use, use dovecot::config instead.

Parameters:

  • comment (Optional[String]) (defaults to: undef)

    An optional comment to be printed at the top of the file instead of the default warning.

  • ensure (Enum['present', 'absent']) (defaults to: 'present')

    Whether the file should be ‘present` or `absent`.

  • file (Stdlib::Absolutepath) (defaults to: $title)

    The file to put the entry in.

  • group (Variant[Integer, String]) (defaults to: 0)

    The group that should own the file.

  • mode (Variant[Integer, String]) (defaults to: $dovecot::configs_mode)

    The permissions for the file.

  • owner (Variant[Integer, String]) (defaults to: 'root')

    The user that should own the file.

See Also:

Author:

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



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'manifests/configfile.pp', line 28

define dovecot::configfile (
  Stdlib::Absolutepath $file = $title,
  Optional[String] $comment = undef,
  Enum['present', 'absent'] $ensure = 'present',
  Variant[Integer, String] $owner = 'root',
  Variant[Integer, String] $group = 0,
  Variant[Integer, String] $mode = $dovecot::configs_mode,
) {
  concat { $file:
    owner  => $owner,
    group  => $group,
    mode   => $mode,
    warn   => !$comment,
    order  => 'alpha',
    notify => Class['dovecot::service'],
  }

  if ($comment) {
    concat::fragment { "dovecot ${file} config 01 file warning comment":
      target  => $file,
      content => join(suffix(prefix(split($comment, '\n'), '# '), '\n')),
    }
  }
}