diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-08-20 11:32:52 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-08-20 11:32:52 -0300 |
commit | 9afb297ee9ea87061b83fa17d4195946443ed80e (patch) | |
tree | f3e928eb3bdc4ee272deb709a7f6c9d86c0f990a /manifests/rsync.pp | |
parent | 3bc1d3326b743b11687d78555dca4c9cfa204f52 (diff) | |
download | puppet-backup-9afb297ee9ea87061b83fa17d4195946443ed80e.tar.gz puppet-backup-9afb297ee9ea87061b83fa17d4195946443ed80e.tar.bz2 |
Changes for autoloading
Diffstat (limited to 'manifests/rsync.pp')
-rw-r--r-- | manifests/rsync.pp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/manifests/rsync.pp b/manifests/rsync.pp new file mode 100644 index 0000000..1e9513e --- /dev/null +++ b/manifests/rsync.pp @@ -0,0 +1,42 @@ +define backup::rsync( + $port = '22', + $ensure = present, + $bandwidthlimit = false, + $use_domain = $::domain, + $use_fqdn = $::fqdn +) { + backupninja::rsync { "rsync-$title.$use_domain": + # [general] + ensure => $ensure, + installkey => false, + home => "${backup::params::backupdir}/remote/$use_fqdn", + backupdir => "${backup::params::backupdir}/remote/$use_fqdn/rsync", + backupkeytype => "rsa", + id_file => "/root/.ssh/id_rsa", + backupkeystore => "puppet:///pubkeys", + keepdaily => '4', + keepweekly => '2', + keepmonthly => '2', + format => 'long', + log => "/var/log/backup/rsync-$title.$use_domain.log", + lockfile => "/var/lock/rsync-$title.$use_domain.lock", + # [source] + include => $backup::params::backup_include_encrypted, + exclude => $backup::params::backup_exclude_encrypted, + # [dest] + user => "$hostname", + host => "$title.$use_domain", + port => $port, + bandwidthlimit => $bandwidthlimit, + compress => '1', + testconnect => 'yes', + } + + if !defined(Ssh_local_key["$hostname"]) { + ssh_local_key { "$hostname": + owner => root, + group => root, + home => '/root', + } + } +} |