params.pp 1.84 KB
Newer Older
1 2 3
class postfix::params {
  case $::osfamily {
    'RedHat': {
4 5 6 7 8 9 10
      $aliasesseltype = $::operatingsystemmajrelease ? {
        '4'     => 'etc_t',
        /5/     => 'postfix_etc_t',
        /6|7/   => 'etc_aliases_t',
        default => undef,
      }

11
      $seltype = $::operatingsystemmajrelease ? {
12
        '4'     => 'etc_t',
13
        /5|6|7/ => 'postfix_etc_t',
14 15 16
        default => undef,
      }

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

22 23 24 25 26 27
      $mailx_package = 'mailx'

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

    'Debian': {
28
      $aliasesseltype = undef
29
      $seltype = undef
30

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

33
      $mailx_package = $::lsbdistcodename ? {
34 35
        /^(sarge|etch|lenny)$/ => 'mailx',
        default                => 'bsd-mailx',
36 37 38 39 40
      }

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

Oliver Bertuch's avatar
Oliver Bertuch committed
41 42 43 44 45
    'Suse': {
      $seltype = undef

      $mailx_package = 'mailx'

46 47 48 49 50 51
      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"
Oliver Bertuch's avatar
Oliver Bertuch committed
52 53 54
      }
    }

55
    default: {
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
      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}'"
        }
      }
71 72 73
    }
  }
}