summaryrefslogtreecommitdiff
path: root/puppet/modules/postfix/manifests/virtual.pp
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2016-11-04 10:54:28 -0400
committerMicah Anderson <micah@riseup.net>2016-11-04 10:54:28 -0400
commit34a381efa8f6295080c843f86bfa07d4e41056af (patch)
tree9282cf5d4c876688602705a7fa0002bc4a810bde /puppet/modules/postfix/manifests/virtual.pp
parent0a72bc6fd292bf9367b314fcb0347c4d35042f16 (diff)
parent5821964ff7e16ca7aa9141bd09a77d355db492a9 (diff)
Merge branch 'develop'
Diffstat (limited to 'puppet/modules/postfix/manifests/virtual.pp')
m---------puppet/modules/postfix0
-rw-r--r--puppet/modules/postfix/manifests/virtual.pp44
2 files changed, 44 insertions, 0 deletions
diff --git a/puppet/modules/postfix b/puppet/modules/postfix
deleted file mode 160000
-Subproject cce918f784ebf8a8875f43c79bc3a1f39ab9456
diff --git a/puppet/modules/postfix/manifests/virtual.pp b/puppet/modules/postfix/manifests/virtual.pp
new file mode 100644
index 00000000..06df32ad
--- /dev/null
+++ b/puppet/modules/postfix/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"]
+- file_line (from module stdlib)
+
+Example usage:
+
+ node "toto.example.com" {
+
+ class { '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) {
+ file_line {"${name} ${destination}":
+ ensure => $ensure,
+ path => "/etc/postfix/virtual",
+ line => "${name} ${destination}",
+ notify => Exec["generate /etc/postfix/virtual.db"],
+ require => Package["postfix"],
+ }
+}