aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/mysql.pp8
-rw-r--r--manifests/rdiff.pp5
-rw-r--r--manifests/server.pp4
-rw-r--r--templates/mysql.conf.erb4
4 files changed, 16 insertions, 5 deletions
diff --git a/manifests/mysql.pp b/manifests/mysql.pp
index e7c0eb4..6241519 100644
--- a/manifests/mysql.pp
+++ b/manifests/mysql.pp
@@ -17,9 +17,15 @@
define backupninja::mysql(
$order = 10, $ensure = present, $user = false, $dbusername = false, $dbpassword = false,
$dbhost = 'localhost', $databases = 'all', $backupdir = false, $hotcopy = false,
- $sqldump = false, $compress = false, $configfile = '/etc/mysql/debian.cnf',
+ $sqldump = false, $compress = false, $configfile = true,
$vsname = false)
{
+
+ $real_configfile = $configfile ? {
+ true => "/etc/mysql/debian.cnf",
+ default => $configfile,
+ }
+
include backupninja::client
file { "${backupninja::client::configdir}/${order}_${name}.mysql":
ensure => $ensure,
diff --git a/manifests/rdiff.pp b/manifests/rdiff.pp
index e3964d0..ed1ea55 100644
--- a/manifests/rdiff.pp
+++ b/manifests/rdiff.pp
@@ -16,7 +16,7 @@
# directories.
#
define backupninja::rdiff(
- $order = 90, $ensure = present, $user = false, $directory = false, $host = false,
+ $order = 90, $ensure = present, $user = false, $home = false, $host = false,
$type = 'local',
$exclude = [ "/home/*/.gnupg", "/home/*/.local/share/Trash", "/home/*/.Trash",
"/home/*/.thumbnails", "/home/*/.beagle", "/home/*/.aMule",
@@ -27,6 +27,7 @@ define backupninja::rdiff(
$ssh_dir = false, $authorized_keys_file = false, $installuser = true, $installkey = true,
$backuptag = false)
{
+ $directory = "$home/rdiff-backup/"
include backupninja::client
case $type {
'remote': {
@@ -34,7 +35,7 @@ define backupninja::rdiff(
backupninja::server::sandbox
{
- "${user}-${name}": user => $user, host => $host, dir => $directory,
+ "${user}-${name}": user => $user, host => $host, dir => $home,
manage_ssh_dir => $ssh_dir_manage, ssh_dir => $ssh_dir,
authorized_keys_file => $authorized_keys_file, installuser => $installuser,
backuptag => $backuptag
diff --git a/manifests/server.pp b/manifests/server.pp
index 162d889..e4298ef 100644
--- a/manifests/server.pp
+++ b/manifests/server.pp
@@ -98,7 +98,7 @@ class backupninja::server {
managehome => true,
shell => "/bin/sh",
password => '*',
- require => Group['backupninjas'],
+ require => [ Group['backupninjas'], File["$real_dir"] ],
tag => "$real_backuptag"
}
}
@@ -112,7 +112,7 @@ class backupninja::server {
managehome => true,
shell => "/bin/sh",
password => '*',
- require => Group['backupninjas'],
+ require => [ Group['backupninjas'], File["$real_dir"] ],
tag => "$real_backuptag"
}
}
diff --git a/templates/mysql.conf.erb b/templates/mysql.conf.erb
index 9d22ab0..14905fd 100644
--- a/templates/mysql.conf.erb
+++ b/templates/mysql.conf.erb
@@ -12,3 +12,7 @@ end -%>
hotcopy = <%= hotcopy ? 'yes' : 'no' %>
sqldump = <%= sqldump ? 'yes' : 'no' %>
compress = <%= compress ? 'yes' : 'no' %>
+
+<% if real_configfile %>
+configfile = <%= real_configfile %>
+<% end %>