Puppet Class: postfix::service

Defined in:
manifests/service.pp

Summary

Optionally manages the postfix service by any name.

Overview

This subclass optionally manages the postfix service. The name of the managed service can be customized if necessary and service management can be entirely disabled.

Examples:

Default; service is managed and always running

---
classes:
  - postfix

Disable service management (e.g.: for containers)

---
classes:
  - postfix
postfix::service_managed: false

Stop the service

---
classes:
  - postfix
postfix::service_ensure: stopped


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'manifests/service.pp', line 24

class postfix::service {
  if $postfix::service_managed
    and ! ($postfix::package_ensure in ['absent', 'purged'])
  {
    service { 'postfix':
      ensure    => $postfix::service_ensure,
      name      => $postfix::service_name,
      enable    => $postfix::service_enable,
      subscribe => [ Package['postfix'], ],
    }

    # Ensure that changes to plugins also trigger service restarts
    Package <| tag == 'postfix-plugin' |> ~> Service['postfix']
  }
}