Enable sending emails.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Sat, 13 Dec 2014 13:04:18 +0000 (14:04 +0100)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Sat, 13 Dec 2014 13:04:18 +0000 (14:04 +0100)
manifests/config.pp
manifests/init.pp
manifests/mail.pp [new file with mode: 0644]
templates/update-exim4.conf.erb [new file with mode: 0644]

index a1c283e..983890d 100644 (file)
@@ -11,6 +11,7 @@ class site_hadoop::config {
   }
 
   if $::osfamily == 'Debian' {
+    # cloudera repo
     exec { 'key-cloudera':
       command => 'apt-key adv --fetch-key http://archive.cloudera.com/cdh5/debian/wheezy/amd64/cdh/archive.key',
       path    => $site_hadoop::path,
index 995f530..b24a989 100644 (file)
@@ -1,8 +1,12 @@
 class site_hadoop inherits site_hadoop::params {
   include 'site_hadoop::install'
   include 'site_hadoop::config'
+  include 'site_hadoop::mail'
 
   Class['site_hadoop::install'] ->
   Class['site_hadoop::config'] ->
   Class['site_hadoop']
+
+  Class['site_hadoop::mail'] ->
+  Class['site_hadoop']
 }
diff --git a/manifests/mail.pp b/manifests/mail.pp
new file mode 100644 (file)
index 0000000..e001316
--- /dev/null
@@ -0,0 +1,23 @@
+# == Class site_hadoop::mail
+#
+# Configure sending emails on Debian.
+#
+class site_hadoop::mail {
+  include stdlib
+
+  if $::osfamily == 'Debian' {
+    ensure_packages(['bsd-mailx'])
+
+    file { '/etc/exim4/update-exim4.conf.conf':
+      content => template('site_hadoop/update-exim4.conf.erb'),
+      require => Package['bsd-mailx'],
+    }
+    ~>
+    service { 'exim4':
+      ensure     => running,
+      enable     => true,
+      hasrestart => true,
+      restart    => 'service exim4 reload',
+    }
+  }
+}
diff --git a/templates/update-exim4.conf.erb b/templates/update-exim4.conf.erb
new file mode 100644 (file)
index 0000000..44ab515
--- /dev/null
@@ -0,0 +1,31 @@
+# /etc/exim4/update-exim4.conf.conf
+#
+# Edit this file and /etc/mailname by hand and execute update-exim4.conf
+# yourself or use 'dpkg-reconfigure exim4-config'
+#
+# Please note that this is _not_ a dpkg-conffile and that automatic changes
+# to this file might happen. The code handling this will honor your local
+# changes, so this is usually fine, but will break local schemes that mess
+# around with multiple versions of the file.
+#
+# update-exim4.conf uses this file to determine variable values to generate
+# exim configuration macros for the configuration file.
+#
+# Most settings found in here do have corresponding questions in the
+# Debconf configuration, but not all of them.
+#
+# This is a Debian specific file
+
+dc_eximconfig_configtype='internet'
+dc_other_hostnames='<%= @fqdn -%>'
+dc_local_interfaces='127.0.0.1 ; ::1'
+dc_readhost=''
+dc_relay_domains=''
+dc_minimaldns='false'
+dc_relay_nets=''
+dc_smarthost=''
+CFILEMODE='644'
+dc_use_split_config='false'
+dc_hide_mailname=''
+dc_mailname_in_oh='true'
+dc_localdelivery='mail_spool'