summaryrefslogtreecommitdiff
path: root/puppet/modules/postfix/manifests/mailalias.pp
blob: 2f239ac33799bc47db6eb3a45651d3e7821cefb4 (plain)
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
/*
== Definition: postfix::mailalias

Wrapper around Puppet mailalias resource, provides newaliases executable.

Parameters:
- *name*: the name of the alias.
- *ensure*: present/absent, defaults to present.
- *recipient*: recipient of the alias.

Requires:
- Class["postfix"]

Example usage:

  node "toto.example.com" {

    class { 'postfix': }

    postfix::mailalias { "postmaster":
      ensure => present,
      recipient => 'foo'
  }

*/
define postfix::mailalias ($ensure = 'present', $recipient) {
    mailalias { "${name}":
        ensure => $ensure,
        recipient => $recipient,
        notify => Exec['newaliases']
    }
}