From 5247b7ccf5b5889ee16262dd976b03047e34e32c Mon Sep 17 00:00:00 2001 From: Micah Date: Tue, 12 Jul 2016 16:46:25 -0400 Subject: git subrepo clone https://leap.se/git/puppet_postfix puppet/modules/postfix subrepo: subdir: "puppet/modules/postfix" merged: "cce918f" upstream: origin: "https://leap.se/git/puppet_postfix" branch: "master" commit: "cce918f" git-subrepo: version: "0.3.0" origin: "https://github.com/ingydotnet/git-subrepo" commit: "1e79595" Change-Id: I325a79fe1780ee6a5d61959310cf8e52c9a6896f --- puppet/modules/postfix/manifests/transport.pp | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 puppet/modules/postfix/manifests/transport.pp (limited to 'puppet/modules/postfix/manifests/transport.pp') diff --git a/puppet/modules/postfix/manifests/transport.pp b/puppet/modules/postfix/manifests/transport.pp new file mode 100644 index 00000000..08b93e5e --- /dev/null +++ b/puppet/modules/postfix/manifests/transport.pp @@ -0,0 +1,44 @@ +/* +== 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). +- *ensure*: present/absent, defaults to present. + +Requires: +- Class["postfix"] +- Postfix::Hash["/etc/postfix/transport"] +- Postfix::Config["transport_maps"] +- file_line (from module stdlib) + +Example usage: + + node "toto.example.com" { + + class { '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", + } + } + +*/ +define postfix::transport ($ensure="present", $destination) { + file_line {"${name} ${destination}": + ensure => $ensure, + path => "/etc/postfix/transport", + line => "${name} ${destination}", + notify => Exec["generate /etc/postfix/transport.db"], + require => Package["postfix"], + } +} -- cgit v1.2.3