From 4111d30992748453eda2ac113faa69b3c61af2c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Sat, 13 Dec 2014 14:04:18 +0100 Subject: [PATCH] Enable sending emails. --- manifests/config.pp | 1 + manifests/init.pp | 4 ++++ manifests/mail.pp | 23 +++++++++++++++++++++++ templates/update-exim4.conf.erb | 31 +++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 manifests/mail.pp create mode 100644 templates/update-exim4.conf.erb diff --git a/manifests/config.pp b/manifests/config.pp index a1c283e..983890d 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -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, diff --git a/manifests/init.pp b/manifests/init.pp index 995f530..b24a989 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 index 0000000..e001316 --- /dev/null +++ b/manifests/mail.pp @@ -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 index 0000000..44ab515 --- /dev/null +++ b/templates/update-exim4.conf.erb @@ -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' -- 1.8.2.3