Defined Type: rspamd::ucl::file

Defined in:
vendor_modules/rspamd/manifests/ucl/file.pp

Summary

manages a single UCL (Universal Configuration Language) config file

Overview

Class: rspamd::ucl::file

Note:

This class is only for internal use, use rspam::config instead.

Parameters:

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

    the file to put the entry in

  • 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`

See Also:

Author:

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



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'vendor_modules/rspamd/manifests/ucl/file.pp', line 17

define rspamd::ucl::file (
  Stdlib::Absolutepath $file        = $title,
  Optional[String] $comment         = undef,
  Enum['present', 'absent'] $ensure = 'present',
) {
  concat { $file:
    owner => 'root',
    # Use '0' for compatibity with Linux ("root") and FreeBSD ("wheel")
    group => 0,
    mode  => '0644',
    warn  => !$comment,
    order => 'alpha',
  }

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