summaryrefslogtreecommitdiff
path: root/manifests/autossh/mail.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/autossh/mail.pp')
-rw-r--r--manifests/autossh/mail.pp52
1 files changed, 52 insertions, 0 deletions
diff --git a/manifests/autossh/mail.pp b/manifests/autossh/mail.pp
new file mode 100644
index 0000000..277beac
--- /dev/null
+++ b/manifests/autossh/mail.pp
@@ -0,0 +1,52 @@
+define tunnel::autossh::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::autossh::instance{ "smtp":
+ host => "${name}.${::domain}",
+ sshport => "${sshport}",
+ localport => '2525',
+ hostport => '25',
+ }
+}