summaryrefslogtreecommitdiff
path: root/puppet/modules/postfix/manifests/transport.pp
diff options
context:
space:
mode:
authorMicah <micah@leap.se>2016-05-24 10:19:37 -0400
committerMicah <micah@leap.se>2016-05-24 10:19:37 -0400
commit38ac177664f763f08153239992568f1aad04c89b (patch)
tree3bb398154ea70b4320f4b4597a8aba8b83a9cf19 /puppet/modules/postfix/manifests/transport.pp
parent93ff36e36236542e6b2a35b0c03a69623662a298 (diff)
parent6570cad05280d8fc9c9c22a403e1dc234ca6ab25 (diff)
Merge commit '6570cad05280d8fc9c9c22a403e1dc234ca6ab25' as 'puppet/modules/postfix'
Diffstat (limited to 'puppet/modules/postfix/manifests/transport.pp')
-rw-r--r--puppet/modules/postfix/manifests/transport.pp44
1 files changed, 44 insertions, 0 deletions
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"],
+ }
+}