aboutsummaryrefslogtreecommitdiff
path: root/manifests/subsystems/tunnel.pp
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-05-29 21:08:01 -0300
committerSilvio Rhatto <rhatto@riseup.net>2010-05-29 21:08:01 -0300
commit581049cbeb494f57a5302f05b5384479e644d757 (patch)
tree0ad4234262ccae1816bda2ef531ee4f2bea146ca /manifests/subsystems/tunnel.pp
parente980a351f0ff9060d7669fcfbda5c9d6c9890ced (diff)
downloadpuppet-nodo-581049cbeb494f57a5302f05b5384479e644d757.tar.gz
puppet-nodo-581049cbeb494f57a5302f05b5384479e644d757.tar.bz2
Setting up relays with nullmailer
Diffstat (limited to 'manifests/subsystems/tunnel.pp')
-rw-r--r--manifests/subsystems/tunnel.pp45
1 files changed, 45 insertions, 0 deletions
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",