Puppet Class: dovecot::package

Defined in:
manifests/package.pp

Summary

Manages all dovecot packages.

Overview

Class: dovecot::package

This subclass manages the dovecot package and all dovecot-* plugin packages.

Examples:

Default; no plugins and dovecot is present but not updated

---
classes:
  - dovecot

Keep dovecot up-to-date

---
classes:
  - dovecot
dovecot::package_ensure: latest

Install the mysql plugin (no automatic updates)

---
classes:
  - dovecot
dovecot::plugin_packages:
  dovecot-mysql: {}

Install the mysql plugin and keep all dovecot packages up-to-date

---
classes:
  - dovecot
dovecot::package_ensure: latest
dovecot::plugin_packages:
  dovecot-mysql:
    ensure: latest

Uninstall everything dovecot-related but retain its configuration

---
classes:
  - dovecot
dovecot::package_ensure: absent

Uninstall everything dovecot-related and destroy its configuration

---
classes:
  - dovecot
dovecot::package_ensure: purged


46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'manifests/package.pp', line 46

class dovecot::package {
  $default_plugin_attributes = {
    ensure  => present,
    require => Package['dovecot'],
    tag     => [ 'dovecot-plugin', ],
  }

  package { 'dovecot':
    ensure => $dovecot::package_ensure,
    name   => $dovecot::package_name,
  }

  pick($dovecot::plugin_packages, {}).each | String $name, Hash $attrs | {
    if $dovecot::package_ensure in ['absent', 'purged'] {
      package { $name:
        ensure => $dovecot::package_ensure,
        before => [ Package['dovecot'], ],
      }
    } else {
      package {
        default: *=> $default_plugin_attributes,;
        $name:   *=> $attrs,;
      }
    }
  }
}