diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2010-05-29 21:08:01 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2010-05-29 21:08:01 -0300 |
commit | 581049cbeb494f57a5302f05b5384479e644d757 (patch) | |
tree | 0ad4234262ccae1816bda2ef531ee4f2bea146ca | |
parent | e980a351f0ff9060d7669fcfbda5c9d6c9890ced (diff) | |
download | puppet-nodo-581049cbeb494f57a5302f05b5384479e644d757.tar.gz puppet-nodo-581049cbeb494f57a5302f05b5384479e644d757.tar.bz2 |
Setting up relays with nullmailer
-rw-r--r-- | manifests/mail.pp | 1 | ||||
-rw-r--r-- | manifests/subsystems/tunnel.pp | 45 |
2 files changed, 46 insertions, 0 deletions
diff --git a/manifests/mail.pp b/manifests/mail.pp index 1771f57..bcc386e 100644 --- a/manifests/mail.pp +++ b/manifests/mail.pp @@ -37,6 +37,7 @@ class nodo::mail { "myhostname": value => "$fqdn"; "mydestination": value => $postfix_mydestination; "mynetworks": value => "127.0.0.0/8"; + "relay_domains": value => "$domain"; "virtual_alias_maps": value => "hash:/etc/postfix/virtual"; "transport_maps": value => "hash:/etc/postfix/transport"; "mailbox_command": value => '/usr/bin/maildrop -d ${USER}'; diff --git a/manifests/subsystems/tunnel.pp b/manifests/subsystems/tunnel.pp index 7bca56f..b396c6e 100644 --- a/manifests/subsystems/tunnel.pp +++ b/manifests/subsystems/tunnel.pp @@ -3,6 +3,7 @@ class tunnel { User <<| tag == "autossh-$fqdn" |>> File <<| tag == "autossh-$fqdn" |>> + # TODO: user setup should be put somewhere define setup($ensure = present, $user = $hostname, $host, $localport, $hostport, $sshport = '22', $keytype = 'dsa') { $dir = "/var/backups/remote/$user.$domain" $tag = "autossh-$host" @@ -68,6 +69,50 @@ class tunnel { } define mail ($sshport = '22') { + package { "nullmailer": + ensure => installed, + } + + service { "nullmailer": + ensure => 'running', + require => Package['nullmailer'], + } + + file { "/etc/mailname": + ensure => present, + owner => root, + group => root, + mode => 0644, + content => "$fqdn\n", + notify => Service["nullmailer"], + } + + file { "/etc/nullmailer": + ensure => directory, + owner => root, + group => root, + mode => 0755, + } + + file { "/etc/nullmailer/remotes": + ensure => present, + owner => root, + group => root, + mode => 0644, + content => "localhost smtp --port=2525\n", + notify => Service["nullmailer"], + require => File["/etc/nullmailer"], + } + + file { "/etc/nullmailer/adminaddr": + ensure => present, + owner => root, + group => root, + mode => 0644, + content => "$root_mail_recipient\n", + require => File["/etc/nullmailer"], + } + tunnel::setup { "smtp": host => "$name.$domain", sshport => "$sshport", |