From e7d7ccccb32405b7f1d33b3580be8d884732f16e Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 14 Apr 2010 14:27:36 -0400 Subject: Reverting "the lvm and luks sys template should default to 'no' for both of these options. turning them on by default means that you get warnings/errors for systems that do not have either of these. you should opt-in, not opt-out" I misunderstood the ternary operator here --- templates/sys.conf.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/sys.conf.erb b/templates/sys.conf.erb index d15f821..a684e8b 100644 --- a/templates/sys.conf.erb +++ b/templates/sys.conf.erb @@ -14,5 +14,5 @@ partitions = <%= partitions ? 'yes' : 'no' %> dosfdisk = <%= dosfdisk ? 'yes' : 'no' %> hardware = <%= hardware ? 'yes' : 'no' %> dohwinfo = <%= dohwinfo ? 'yes' : 'no' %> -luksheaders = <%= doluks ? 'no' : 'yes' %> -lvm = <%= dolvm ? 'no' : 'yes' %> +luksheaders = <%= doluks ? 'yes' : 'no' %> +lvm = <%= dolvm ? 'yes' : 'no' %> -- cgit v1.2.3 From 4b587a76cbe90bada8231ba2019e7e462b00f17d Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 14 Apr 2010 14:52:49 -0400 Subject: change the parameter values in the sys handler to use true/false values for the default to be more uniform with the other handler definitions --- manifests/sys.pp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/manifests/sys.pp b/manifests/sys.pp index ac42e37..7de319c 100644 --- a/manifests/sys.pp +++ b/manifests/sys.pp @@ -13,16 +13,16 @@ define backupninja::sys($order = 30, $ensure = present, $parentdir = '/var/backups', - $packages = yes, + $packages = true, $packagesfile = '/var/backups/dpkg-selections.txt', - $partitions = yes, + $partitions = true, $partitionsfile = '/var/backups/partitions.__star__.txt', - $dosfdisk = yes, - $hardware = yes, + $dosfdisk = true, + $hardware = true, $hardwarefile = '/var/backups/hardware.txt', - $dohwinfo = yes, - $doluks = no, - $dolvm = no + $dohwinfo = true, + $doluks = false, + $dolvm = false ) { include backupninja::client::defaults file { "${backupninja::client::defaults::configdir}/${order}_${name}.sys": -- cgit v1.2.3 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