Puppet Class: isp3node::postfix::setup

Defined in:
manifests/postfix/setup.pp

Summary

Setup postfix mail service on this host

Overview

Examples:

include isp3node::postfix::setup

Parameters:

  • options (Hash)

    Options to apply to the postfix class in addition to hardcoded default options

  • master_submission (String)

    Textblock to write as subnission-block into master.cf

  • master_smtps (String)

    Textblock to write as smtps block into master.cf

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

    Additional options beside optional configuration via $opions, that are required by ispconfigs server setup

  • ispopts_mailman (Optional[Hash]) (defaults to: {})

    Additional options that are required, if this host is set up with mailman

  • additional_packages (Optional[Array[String]]) (defaults to: [])

    Additional software to install after installing and configuring postfix

  • ispconf (Hash) (defaults to: {})
  • ispconf_mailman (Hash) (defaults to: {})


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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
# File 'manifests/postfix/setup.pp', line 17

class isp3node::postfix::setup(
  Hash $options,
  String $master_submission,
  String $master_smtps,
  Hash $ispopts = {}, # applied to postfix main class
  Optional[Hash] $ispopts_mailman = {},
  Hash $ispconf = {}, # applied as additional config resource
  Hash $ispconf_mailman = {},
  Optional[Array[String]] $additional_packages = [],
) {
  $default_opts = {
    root_mail_recipient => lookup('isp3node::email'),
    myorigin => $facts['fqdn'],
    mydestination => "${facts[fqdn]}, localhost, localhost.localdomain",
    master_submission => $master_submission,
    master_smtps => $master_smtps,
    manage_mailx => true,
    # ? use_amavisd => true,
    # ? use_dovecot_lda = true,
  }
  unless($facts['isp3node']['mailman']['installed']){
    class {'postfix':
      * => $options + $default_opts + $ispopts
    }
  } else{
    class {'postfix':
      * => $options + $default_opts + $ispopts + $ispopts_mailman
    }
  }
  package{$additional_packages:
    ensure  => latest,
    require => Class['postfix'],
  }
  # Add ispconfig settings only if ispconfig server is installed!
  if($facts['isp3node']['ispconfig']['installed']){
    unless($facts['isp3node']['mailman']['installed']){
      $ispconf.each |$s, $v| {
        postfix::config{$s:
          ensure => present,
          value  => $v,
        }
      }
    } else {
      ($ispconf + $ispconf_mailman).each |$s, $v| {
        postfix::config{$s:
          ensure => present,
          value  => $v,
        }
      }
    }
  }
}