From 59010a1c304801db6423f67d656399478fc603f0 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 16 Feb 2012 16:51:56 +0100 Subject: put classes and defines in the proper place To take advantage of puppet's autoloading feature, which will be mandatory sooner or later. We move all the files in their appropriate place. --- manifests/virtual.pp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 manifests/virtual.pp (limited to 'manifests/virtual.pp') diff --git a/manifests/virtual.pp b/manifests/virtual.pp new file mode 100644 index 0000000..8fcd53a --- /dev/null +++ b/manifests/virtual.pp @@ -0,0 +1,44 @@ +/* +== 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, defaults to present. + +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", + } + } + +*/ +define postfix::virtual ($ensure="present", $destination) { + line {"${name} ${destination}": + ensure => $ensure, + file => "/etc/postfix/virtual", + line => "${name} ${destination}", + notify => Exec["generate /etc/postfix/virtual.db"], + require => Package["postfix"], + } +} -- cgit v1.2.3