From 125a05c0e0bd27a93df85a6f64a8227c375b3563 Mon Sep 17 00:00:00 2001 From: etlweather Date: Sun, 1 Feb 2015 21:05:01 -0500 Subject: [PATCH 1/5] Added support for mail.domain and mail.encryption --- manifests/job.pp | 2 ++ templates/job/email.erb | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/manifests/job.pp b/manifests/job.pp index 949ede3..f403353 100644 --- a/manifests/job.pp +++ b/manifests/job.pp @@ -68,6 +68,8 @@ $email_to = undef, $relay_host = 'localhost', $relay_port = '25', + $mail_domain = undef, + $mail_encryption = undef, # Hipchat $enable_hc = false, $hc_success = false, diff --git a/templates/job/email.erb b/templates/job/email.erb index c002335..b24dd05 100644 --- a/templates/job/email.erb +++ b/templates/job/email.erb @@ -12,5 +12,11 @@ <% end -%> <% if @relay_host -%> mail.port = <%= @relay_port %> +<% end -%> +<% if @mail_domain -%> + mail.domain = <%= @mail_domain %> +<% end -%> +<% if @mail_encryption -%> + mail.encryption = <%= @mail_encryption %> <% end -%> end From 5b56b7ab5dbb5d8f265d34daddedbf0406f337a1 Mon Sep 17 00:00:00 2001 From: etlweather Date: Sun, 1 Feb 2015 21:23:35 -0500 Subject: [PATCH 2/5] Removed to_email validation to allow for multiple email --- manifests/job.pp | 2 -- 1 file changed, 2 deletions(-) diff --git a/manifests/job.pp b/manifests/job.pp index f403353..99075d7 100644 --- a/manifests/job.pp +++ b/manifests/job.pp @@ -230,8 +230,6 @@ if !$email_to { fail("[Backup::Job::${name}]: A destination email address is required for email notifications") - } else { - validate_re($email_to, '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$', "[Backup::Job::${name}]: ${email_to} is not a valid email address") } if $relay_port and !is_integer($relay_port) { From 9117516f4812ba16c80768eeb076a828d4548f58 Mon Sep 17 00:00:00 2001 From: etlweather Date: Sun, 1 Feb 2015 21:35:33 -0500 Subject: [PATCH 3/5] Added quotes --- templates/job/email.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/job/email.erb b/templates/job/email.erb index b24dd05..6a185ca 100644 --- a/templates/job/email.erb +++ b/templates/job/email.erb @@ -14,7 +14,7 @@ mail.port = <%= @relay_port %> <% end -%> <% if @mail_domain -%> - mail.domain = <%= @mail_domain %> + mail.domain = "<%= @mail_domain %>" <% end -%> <% if @mail_encryption -%> mail.encryption = <%= @mail_encryption %> From 87b41f259fad15a34e03a1f9fe8ab1ba71022e8c Mon Sep 17 00:00:00 2001 From: etlweather Date: Sun, 1 Feb 2015 21:38:26 -0500 Subject: [PATCH 4/5] Added documentation --- README.md | 12 ++++++++++++ manifests/job.pp | 2 ++ 2 files changed, 14 insertions(+) diff --git a/README.md b/README.md index bd9f947..31500f9 100644 --- a/README.md +++ b/README.md @@ -324,6 +324,18 @@ Integer. Port on `relayhost` emails should be sent to Default: 25 +##### `mail_encryption` + +String. Encryption to be used. + +Default: not defined (backup currently defaults to `:starttls`. + +##### `mail_domain` + +String. Your host name for the HELO command. + +Default: none. + ##### `enable_hc` Boolean. Whether backup job noticies should be sent to HipChat diff --git a/manifests/job.pp b/manifests/job.pp index 99075d7..cc90fc5 100644 --- a/manifests/job.pp +++ b/manifests/job.pp @@ -415,6 +415,8 @@ # - $email_to # - $relay_host # - $relay_port + # - $mail_domain + # - $mail_encryption concat::fragment { "${_name}_email": target => "/etc/backup/models/${_name}.rb", content => template('backup/job/email.erb'), From 8e261a1ac15cc8c1abb8b6898f447abb84931bdc Mon Sep 17 00:00:00 2001 From: etlweather Date: Tue, 12 May 2015 21:29:27 -0400 Subject: [PATCH 5/5] Found zlib1g-dev being required on fresh Ubuntu 14.04 install --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 14d2ac6..41d2f22 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -18,7 +18,7 @@ } } 'Debian': { - $package_dependencies = ['ruby-dev', 'libxslt1-dev', 'libxml2-dev', 'g++', 'patch'] + $package_dependencies = ['ruby-dev', 'libxslt1-dev', 'libxml2-dev', 'g++', 'patch', 'zlib1g-dev'] if $::lsbmajordistrelease { $releaseversion = $::lsbmajordistrelease }