Defined Type: directadmin::mail::exim::config

Defined in:
manifests/mail/exim/config.pp

Overview

directadmin::mail::exim::config

Parameters:

  • value (Any) (defaults to: undef)
  • file (Any) (defaults to: undef)


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'manifests/mail/exim/config.pp', line 2

define directadmin::mail::exim::config(
  $value = undef,
  $file  = undef,
) {
  # Check the $file parameter
  if $file == undef { fail('file must be set.') }
  if $file =~ /\/etc/ { fail('file should be specified without /etc') }

  # Check $value parameter - we don't do consistency checks!
  if $value == undef { fail('value must be set.') }

  # Manage /etc/${file}
  ensure_resource('file', "/etc/${file}", { 'ensure' => 'present', 'mode' => '0644'} )

  file_line { "exim-set-${file}-${title}-${value}":
    path    => "/etc/${file}",
    line    => "${title}==${value}",
    match   => "^${title}==",
    require => File["/etc/${file}"],
    notify  => Service['exim'],
  }
}