]> gitweb.fluxo.info Git - puppet-backup.git/commitdiff
Adding use_domain and use_fqdn for backup::rsync
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 14 Jan 2014 14:48:37 +0000 (12:48 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 14 Jan 2014 14:48:37 +0000 (12:48 -0200)
manifests/init.pp

index 9c29d271834e5d2666507cd26fe4997f4fcce49b..73c78e2f8445991c3e7fe8ca40c87f710be383b5 100644 (file)
@@ -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',