Puppet Class: postfix::service

Defined in:
manifests/service.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
# File 'manifests/service.pp', line 1

class postfix::service {
  exec { 'restart postfix after packages install':
    command     => regsubst($::postfix::params::restart_cmd, 'reload', 'restart'),
    refreshonly => true,
    subscribe   => Package['postfix'],
    require     => Class['postfix::files'],
  }
  service { 'postfix':
    ensure    => $::postfix::service_ensure,
    enable    => $::postfix::service_enabled,
    hasstatus => true,
    restart   => $::postfix::params::restart_cmd,
  }
  # Aliases
  exec { 'newaliases':
    command     => '/usr/bin/newaliases',
    refreshonly => true,
    subscribe   => File['/etc/aliases'],
    require     => Service['postfix'],
  }
  if $::osfamily == 'RedHat' {
    alternatives { 'mta':
      path    => '/usr/sbin/sendmail.postfix',
      require => Service['postfix'],
    }
  }
}