diff options
author | Micah Anderson <micah@riseup.net> | 2016-11-04 10:54:28 -0400 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2016-11-04 10:54:28 -0400 |
commit | 34a381efa8f6295080c843f86bfa07d4e41056af (patch) | |
tree | 9282cf5d4c876688602705a7fa0002bc4a810bde /puppet/modules/postfix/manifests/mta.pp | |
parent | 0a72bc6fd292bf9367b314fcb0347c4d35042f16 (diff) | |
parent | 5821964ff7e16ca7aa9141bd09a77d355db492a9 (diff) |
Merge branch 'develop'
Diffstat (limited to 'puppet/modules/postfix/manifests/mta.pp')
m--------- | puppet/modules/postfix | 0 | ||||
-rw-r--r-- | puppet/modules/postfix/manifests/mta.pp | 70 |
2 files changed, 70 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/mta.pp b/puppet/modules/postfix/manifests/mta.pp new file mode 100644 index 00000000..f7a865db --- /dev/null +++ b/puppet/modules/postfix/manifests/mta.pp @@ -0,0 +1,70 @@ +# +# == Class: postfix::mta +# +# This class configures a minimal MTA, listening on +# $postfix_smtp_listen (default to localhost) and delivering mail to +# $postfix_mydestination (default to $fqdn). +# +# A valid relay host is required ($postfix_relayhost) for outbound email. +# +# transport & virtual maps get configured and can be populated with +# postfix::transport and postfix::virtual +# +# Parameters: +# - *$postfix_relayhost* +# - *$postfix_mydestination* +# - every global variable which works for class "postfix" will work here. +# +# Requires: +# - Class["postfix"] +# +# Example usage: +# +# node "toto.example.com" { +# +# class { 'postfix': +# smtp_listen => "0.0.0.0", +# } +# +# class { 'postfix::mta': +# relayhost => "mail.example.com", +# mydestination => "\$myorigin, myapp.example.com", +# } +# +# postfix::transport { "myapp.example.com": +# ensure => present, +# destination => "local:", +# } +# } +# +class postfix::mta( + $mydestination = '', + $relayhost = '' +) { + + #case $relayhost { + # "": { fail("Required relayhost parameter is not defined.") } + #} + + case $mydestination { + "": { $postfix_mydestination = "\$myorigin" } + default: { $postfix_mydestination = "$mydestination" } + } + + postfix::config { + "mydestination": value => $postfix_mydestination; + "mynetworks": value => "127.0.0.0/8"; + "relayhost": value => $relayhost; + "virtual_alias_maps": value => "hash:/etc/postfix/virtual"; + "transport_maps": value => "hash:/etc/postfix/transport"; + } + + postfix::hash { "/etc/postfix/virtual": + ensure => present, + } + + postfix::hash { "/etc/postfix/transport": + ensure => present, + } + +} |