aboutsummaryrefslogtreecommitdiff
path: root/manifests/subsystems
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/subsystems')
-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",