transport.pp 1.07 KB
Newer Older
1
2
3
4
5
6
7
8
/*
== Definition: postfix::transport

Manages content of the /etc/postfix/transport map.

Parameters:
- *name*: name of address postfix will lookup. See transport(5).
- *destination*: where the emails will be delivered to. See transport(5).
9
- *ensure*: present/absent, defaults to present.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

Requires:
- Class["postfix"]
- Postfix::Hash["/etc/postfix/transport"]
- Postfix::Config["transport_maps"]
- common::line (from module common)

Example usage:

  node "toto.example.com" {

    include postfix

    postfix::hash { "/etc/postfix/transport":
      ensure => present,
    }
    postfix::config { "transport_maps":
      value => "hash:/etc/postfix/transport"
    }
    postfix::transport { "mailman.example.com":
      ensure      => present,
      destination => "mailman",
    }
  }

*/
36
define postfix::transport ($ensure="present", $destination) {
37
  line {"${name} ${destination}":
38
    ensure => $ensure,
39
40
41
    file   => "/etc/postfix/transport",
    line   => "${name} ${destination}",
    notify => Exec["generate /etc/postfix/transport.db"],
42
    require => Package["postfix"],
43
44
  }
}