2009-08-28 11:15:35 +02:00
|
|
|
/*
|
|
|
|
== Definition: postfix::virtual
|
|
|
|
|
|
|
|
Manages content of the /etc/postfix/virtual map.
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
- *name*: name of address postfix will lookup. See virtual(8).
|
|
|
|
- *destination*: where the emails will be delivered to. See virtual(8).
|
|
|
|
- *ensure*: present/absent
|
|
|
|
|
|
|
|
Requires:
|
|
|
|
- Class["postfix"]
|
|
|
|
- Postfix::Hash["/etc/postfix/virtual"]
|
|
|
|
- Postfix::Config["virtual_alias_maps"]
|
|
|
|
- common::line (from module common)
|
|
|
|
|
|
|
|
Example usage:
|
|
|
|
|
|
|
|
node "toto.example.com" {
|
|
|
|
|
|
|
|
include postfix
|
|
|
|
|
|
|
|
postfix::hash { "/etc/postfix/virtual":
|
|
|
|
ensure => present,
|
|
|
|
}
|
|
|
|
postfix::config { "virtual_alias_maps":
|
|
|
|
value => "hash:/etc/postfix/virtual"
|
|
|
|
}
|
|
|
|
postfix::virtual { "user@example.com":
|
|
|
|
ensure => present,
|
|
|
|
destination => "root",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
2009-03-02 12:29:31 +01:00
|
|
|
define postfix::virtual ($ensure, $destination) {
|
2008-12-03 17:53:28 +01:00
|
|
|
line {"${name} ${destination}":
|
|
|
|
ensure => present,
|
|
|
|
file => "/etc/postfix/virtual",
|
|
|
|
line => "${name} ${destination}",
|
|
|
|
notify => Exec["generate /etc/postfix/virtual.db"],
|
2009-07-21 21:44:03 +02:00
|
|
|
require => Package["postfix"],
|
2008-12-03 17:53:28 +01:00
|
|
|
}
|
|
|
|
}
|