service.pp 615 Bytes
Newer Older
1
class postfix::service {
2
3
4
5
6
7
  exec { 'restart postfix after packages install':
    command     => regsubst($::postfix::params::restart_cmd, 'reload', 'restart'),
    refreshonly => true,
    subscribe   => Package['postfix'],
    require     => Class['postfix::files'],
  }
8
  service { 'postfix':
9
10
    ensure    => $::postfix::service_ensure,
    enable    => $::postfix::service_enabled,
11
    hasstatus => true,
12
    restart   => $::postfix::params::restart_cmd,
13
  }
14
  if $::osfamily == 'RedHat' {
15
16
    alternatives { 'mta':
      path    => '/usr/sbin/sendmail.postfix',
17
18
19
      require => Service['postfix'],
    }
  }
20
}