From 93851f9f3677009885e54fd53d9150aa5f527078 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 1 Nov 2010 16:59:22 -0400 Subject: fix template to not include configuration lines if they are not defined this was necessary to change because in puppet 2.6, if you did not set one of the variables that had no defaults (eg. reporthost), you would get a backupninja config file with 'reporthost = undef', which is not valid for backupninja --- templates/backupninja.conf.erb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/templates/backupninja.conf.erb b/templates/backupninja.conf.erb index 960d39f..abc7c29 100644 --- a/templates/backupninja.conf.erb +++ b/templates/backupninja.conf.erb @@ -8,9 +8,15 @@ when = <%= send(:when) %> reportemail = <%= reportemail %> reportsuccess = <%= reportsuccess ? 'yes' : 'no' %> reportwarning = <%= reportwarning ? 'yes' : 'no' %> -reporthost = <%= reporthost %> -reportuser = <%= reportuser %> -reportdirectory = <%= reportdirectory %> +<% if reporthost.is_a? String -%> +<%= 'reporthost = ' + reporthost %> +<% end -%> +<% if reportuser.is_a? String -%> +<%= 'reportuser = ' + reportuser %> +<% end -%> +<% if reportdirectory.is_a? String -%> +<%= 'reportdirectory = ' + reportdirectory %> +<% end -%> logfile = <%= logfile %> configdirectory = <%= configdir %> scriptdirectory = <%= scriptdir %> -- cgit v1.2.3