Puppet Class: postfix::mastercf

Defined in:
manifests/mastercf.pp

Summary

manage postfix master.cf

Overview

Examples:

Basic usage


class { 'postfix::mastercf': }
postfix::mastercf::process { '127.0.0.1:10025':
  type    => 'inet',
  private => false,
  unpriv  => true,
  chroot  => false,
  wakeup  => undef,
  maxproc => undef,
	comment => "custom smtpd service",
  command => "smtpd
    -o syslog_name=\$custom_smtpd_syslog_name",
}

Parameters:

  • ensure (Any) (defaults to: 'present')

    Ensure status. Set to ‘present` or `absent`.

  • smtpd_maxproc (Any) (defaults to: $::postfix::smtpd_maxproc)

    Number of processes for the smtp process.

  • smtpd_options (Any) (defaults to: $::postfix::smtpd_options)

    Options for the smtp process.

  • manage_smtp (Any) (defaults to: $::postfix::manage_smtp)

    Could be used to disable the default smtp service line (port 25). In case you want to manage it yourself.

  • manage_default_processes (Any) (defaults to: $::postfix::manage_default_processes)

    Could be used to disable the default master.cf processes. In case you want to manage everything yourself. Does not include the smtp process. See ‘manage_smtp` option.



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'manifests/mastercf.pp', line 32

class postfix::mastercf (
  $ensure = 'present',
  $smtpd_maxproc= $::postfix::smtpd_maxproc,
  $smtpd_options= $::postfix::smtpd_options,
  $manage_smtp= $::postfix::manage_smtp,
  $manage_default_processes= $::postfix::manage_default_processes,
) {
  $etc_dir = $::postfix::install::etc_dir
  $path = "${etc_dir}/master.cf"
  $manage_service = $::postfix::manage_service
  $service_name = $::postfix::install::service_name

  concat { $path:
    ensure => $ensure,
    owner  => 'root',
    group  => 'root',
    mode   => '0640',
  }
  if( $manage_service ) {
    Concat[$path] ~> Service[$service_name]
  }
  concat::fragment{ "${path}-head":
    target  => $path,
    content => template('postfix/mastercf/head.erb'),
    order   => '01'
  }
  if( $manage_smtp ) {
    postfix::mastercf::process { 'smtp':
      type    => 'inet',
      private => false,
      unpriv  => undef,
      chroot  => true,
      wakeup  => undef,
      maxproc => $smtpd_maxproc,
      command => 'smtpd',
      options => $smtpd_options,
    }
  }
  if( $manage_default_processes ) {
    concat::fragment{ "${path}-default-processes":
      target  => $path,
      content => template('postfix/mastercf/default-processes.erb'),
      order   => '99'
    }
  }
}