Puppet Class: dovecot::service

Defined in:
manifests/service.pp

Summary

Optionally manages the dovecot service by any name.

Overview

Class: dovecot::service

This subclass optionally manages the dovecot 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:
  - dovecot

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

---
classes:
  - dovecot
dovecot::service_managed: false

Stop the service

---
classes:
  - dovecot
dovecot::service_ensure: stopped


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

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

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