aboutsummaryrefslogtreecommitdiff
path: root/manifests/rdiff.pp
blob: 7cf6ed034175c9ea19b5fe31fecda3e52e67f203 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# default backupninja::rdiff configuration
define backup::rdiff(
  $port = '22',
  $ensure = present
) {
  backupninja::rdiff { "rdiff-$title.$domain":
    ensure         => $ensure,
    options        => "--remote-schema 'ssh -p $port -C %s rdiff-backup --server'",
    # [source]
    keep           => "10",
    include        => $backup::params::include_encrypted,
    exclude        => $backup::params::exclude_encrypted,
    # [dest]
    type           => "remote",
    host           => "$title.$domain",
    home           => "${backup::params::backupdir}/remote/$fqdn",
    subfolder      => "rdiff",
    user           => "$hostname",
    sshoptions     => "-p $port",
    backupkeytype  => "rsa",
    backupkeystore => "puppet:///pubkeys",
    sandbox        => false,
  }

  if !defined(Ssh_local_key["$hostname"]) {
    ssh_local_key { "$hostname":
      owner => root,
      group => root,
      home  => '/root',
    }
  }
}