Puppet Class: postfix::params

Inherited by:
postfix
Defined in:
manifests/params.pp

Overview



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
69
70
71
72
73
# File 'manifests/params.pp', line 1

class postfix::params {
  case $::osfamily {
    'RedHat': {
      $aliasesseltype = $::operatingsystemmajrelease ? {
        '4'     => 'etc_t',
        /5/     => 'postfix_etc_t',
        /6|7/   => 'etc_aliases_t',
        default => undef,
      }

      $seltype = $::operatingsystemmajrelease ? {
        '4'     => 'etc_t',
        /5|6|7/ => 'postfix_etc_t',
        default => undef,
      }

      $restart_cmd = $::operatingsystemmajrelease ? {
        '7'     => '/bin/systemctl reload postfix',
        default => '/etc/init.d/postfix reload',
      }

      $mailx_package = 'mailx'

      $master_os_template = "${module_name}/master.cf.redhat.erb"
    }

    'Debian': {
      $aliasesseltype = undef
      $seltype = undef

      $restart_cmd = '/etc/init.d/postfix reload'

      $mailx_package = $::lsbdistcodename ? {
        /^(sarge|etch|lenny)$/ => 'mailx',
        default                => 'bsd-mailx',
      }

      $master_os_template = "${module_name}/master.cf.debian.erb"
    }

    'Suse': {
      $seltype = undef

      $mailx_package = 'mailx'

      if $::operatingsystemmajrelease == '11' {
        $restart_cmd = '/etc/init.d/postfix reload'
        $master_os_template = "${module_name}/master.cf.${::operatingsystem}${::operatingsystemrelease}.erb"
      } else {
        $restart_cmd = '/usr/bin/systemctl reload postfix'
        $master_os_template = "${module_name}/master.cf.sles.erb"
      }
    }

    default: {
      case $::operatingsystem {
        'Alpine': {
            $aliasesseltype = undef
            $seltype = undef

            $restart_cmd = '/etc/init.d/postfix reload'

            $mailx_package = 'mailx'

            $master_os_template = "${module_name}/master.cf.debian.erb"
        }
        default: {
          fail "Unsupported OS family '${::osfamily}' and OS '${::operatingsystem}'"
        }
      }
    }
  }
}