aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-01-14 12:48:37 -0200
committerSilvio Rhatto <rhatto@riseup.net>2014-01-14 12:48:37 -0200
commit115d16718c85ceae07fdde36d1f846f8de0402ba (patch)
treef758c527fa53b0576f2e6144071d5cda389f5865
parent5dba68ca20097b6ce8e2b6e72565e81f60855ba3 (diff)
downloadpuppet-backup-115d16718c85ceae07fdde36d1f846f8de0402ba.tar.gz
puppet-backup-115d16718c85ceae07fdde36d1f846f8de0402ba.tar.bz2
Adding use_domain and use_fqdn for backup::rsync
-rw-r--r--manifests/init.pp19
1 files changed, 12 insertions, 7 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 9c29d27..73c78e2 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -203,13 +203,18 @@ class backup(
}
}
- define rsync($port = '22', $ensure = present, $installkey = true, $bandwidthlimit = false) {
- backupninja::rsync { "rsync-$title.$domain":
+ define rsync($port = '22',
+ $ensure = present,
+ $installkey = true,
+ $bandwidthlimit = false,
+ $use_domain = $::domain,
+ $use_fqdn = $::fqdn) {
+ backupninja::rsync { "rsync-$title.$use_domain":
# [general]
ensure => $ensure,
installkey => $installkey,
- home => "$backupdir/remote/$fqdn",
- backupdir => "$backupdir/remote/$fqdn/rsync",
+ home => "$backupdir/remote/$use_fqdn",
+ backupdir => "$backupdir/remote/$use_fqdn/rsync",
backupkeytype => "rsa",
id_file => "/root/.ssh/id_rsa",
backupkeystore => "puppet:///modules/site_keys",
@@ -217,14 +222,14 @@ class backup(
keepweekly => '2',
keepmonthly => '2',
format => 'long',
- log => "/var/log/backup/rsync-$title.$domain.log",
- lockfile => "/var/lock/rsync-$title.$domain.lock",
+ log => "/var/log/backup/rsync-$title.$use_domain.log",
+ lockfile => "/var/lock/rsync-$title.$use_domain.lock",
# [source]
include => $backup_include_encrypted,
exclude => $backup_exclude_encrypted,
# [dest]
user => "$hostname",
- host => "$title.$domain",
+ host => "$title.$use_domain",
port => $port,
bandwidthlimit => $bandwidthlimit,
compress => '1',