aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>2015-04-17 15:19:59 -0400
committerJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>2015-04-17 17:12:16 -0400
commit8d97365688f59a8990fa549d0a0cc227d1187e76 (patch)
tree6305d85d28fdcdf8ec47858e0fa540b1636c6cec
parentd18c3e038a1018a86b6cd94b7076cd8bc7163271 (diff)
downloadpuppet-backupninja-8d97365688f59a8990fa549d0a0cc227d1187e76.tar.gz
puppet-backupninja-8d97365688f59a8990fa549d0a0cc227d1187e76.tar.bz2
Merge backupninja:config class into base client class
-rw-r--r--manifests/init.pp22
-rw-r--r--templates/backupninja.conf.erb12
2 files changed, 28 insertions, 6 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 9faba5d..17f83df 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -13,6 +13,21 @@ class backupninja (
$keyowner = 0,
$keygroup = 0,
$keymanage = true,
+ $configfile = '/etc/backupninja.conf',
+ $loglvl = 4,
+ $when = 'everyday at 01:00',
+ $reportemail = 'root',
+ $reportsuccess = false,
+ $reportwarning = true,
+ $reporthost = undef,
+ $reportuser = undef,
+ $reportdirectory = undef,
+ $logfile = '/var/log/backupninja.log',
+ $configdir = '/etc/backup.d',
+ $scriptdir = '/usr/share/backupninja',
+ $libdir = '/usr/lib/backupninja',
+ $usecolors = true,
+ $vservers = false
) {
# install client dependencies
@@ -65,4 +80,11 @@ class backupninja (
}
}
+ file { $configfile:
+ content => template('backupninja/backupninja.conf.erb'),
+ owner => root,
+ group => 0,
+ mode => '0644'
+ }
+
}
diff --git a/templates/backupninja.conf.erb b/templates/backupninja.conf.erb
index abc7c29..fe7affa 100644
--- a/templates/backupninja.conf.erb
+++ b/templates/backupninja.conf.erb
@@ -8,14 +8,14 @@ when = <%= send(:when) %>
reportemail = <%= reportemail %>
reportsuccess = <%= reportsuccess ? 'yes' : 'no' %>
reportwarning = <%= reportwarning ? 'yes' : 'no' %>
-<% if reporthost.is_a? String -%>
-<%= 'reporthost = ' + reporthost %>
+<% if @reporthost -%>
+<%= 'reporthost = ' + @reporthost %>
<% end -%>
-<% if reportuser.is_a? String -%>
-<%= 'reportuser = ' + reportuser %>
+<% if @reportuser -%>
+<%= 'reportuser = ' + @reportuser %>
<% end -%>
-<% if reportdirectory.is_a? String -%>
-<%= 'reportdirectory = ' + reportdirectory %>
+<% if @reportdirectory -%>
+<%= 'reportdirectory = ' + @reportdirectory %>
<% end -%>
logfile = <%= logfile %>
configdirectory = <%= configdir %>