service.pp 801 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 15 16 17 18 19 20
  # Aliases
  exec { 'newaliases':
    command     => '/usr/bin/newaliases',
    refreshonly => true,
    subscribe   => File['/etc/aliases'],
    require     => Service['postfix'],
  }
21
  if $::osfamily == 'RedHat' {
22 23
    alternatives { 'mta':
      path    => '/usr/sbin/sendmail.postfix',
24 25 26
      require => Service['postfix'],
    }
  }
27
}