Puppet Class: postfix::package

Defined in:
manifests/package.pp

Summary

Manages the postfix package.

Overview

This subclass manages the postfix package.

Examples:

Default; postfix is present but not updated

---
classes:
  - postfix

Keep postfix up-to-date

---
classes:
  - postfix

postfix::package_ensure: latest

Uninstall everything postfix-related but retain its configuration

---
classes:
  - postfix

postfix::package_ensure: absent

Uninstall everything postfix-related and destroy its configuration

---
classes:
  - postfix

postfix::package_ensure: purged

Install some plugins and keep them up-to-date

---
classes:
  - postfix

postfix::package_ensure: latest
postfix::plugin_packages:
  postfix-ldap:
    ensure: latest
  postfix-perl-scripts:
    ensure: latest


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

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

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

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