File: service.pp

package info (click to toggle)
puppet-module-camptocamp-postfix 5.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 576 kB
  • sloc: ruby: 1,544; sh: 10; makefile: 4
file content (38 lines) | stat: -rw-r--r-- 1,004 bytes parent folder | download
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
# @summary Manage service resources for postfix
#
# @api private
#
class postfix::service {
  assert_private()

  $manage_aliases = $postfix::manage_aliases

  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
  if $manage_aliases {
    exec { 'newaliases':
      command     => 'newaliases',
      path        => $facts['path'],
      refreshonly => true,
      subscribe   => File['/etc/aliases'],
      require     => Service['postfix'],
    }
  }
  if $facts['os']['family'] == 'RedHat' {
    alternatives { 'mta':
      path    => '/usr/sbin/sendmail.postfix',
      require => Service['postfix'],
    }
  }
}