diff options
author | Jesse Luehrs <doy@tozt.net> | 2018-11-18 18:03:02 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2018-11-18 18:03:02 -0500 |
commit | dabf1dba0dfe48a67ff551f065415fe8e17b3b10 (patch) | |
tree | 6a79845a3b96676227fde3d0bf2be86c9865f838 /modules/duplicati | |
parent | 9856bdc1b2a354a835619cef0da4e348f45960c5 (diff) | |
download | puppet-tozt-dabf1dba0dfe48a67ff551f065415fe8e17b3b10.tar.gz puppet-tozt-dabf1dba0dfe48a67ff551f065415fe8e17b3b10.zip |
create a duplicati backup on partofme
Diffstat (limited to 'modules/duplicati')
-rw-r--r-- | modules/duplicati/manifests/backup.pp | 22 | ||||
-rw-r--r-- | modules/duplicati/manifests/client.pp | 2 |
2 files changed, 24 insertions, 0 deletions
diff --git a/modules/duplicati/manifests/backup.pp b/modules/duplicati/manifests/backup.pp new file mode 100644 index 0000000..5c6dd5d --- /dev/null +++ b/modules/duplicati/manifests/backup.pp @@ -0,0 +1,22 @@ +define duplicati::backup($content) { + include duplicati + + file { "/etc/duplicati/$name.json": + content => $content, + require => File['/etc/duplicati']; + } + + exec { "load backup for $name": + provider => shell, + command => " + duplicati-client login + duplicati-client create backup /etc/duplicati/$name.json + duplicati-client logout + ", + unless => "duplicati-client list backups | grep -qF '- $name:'", + require => [ + Class['duplicati'], + File["/etc/duplicati/$name.json"], + ]; + } +} diff --git a/modules/duplicati/manifests/client.pp b/modules/duplicati/manifests/client.pp index 62fc820..d12e6c4 100644 --- a/modules/duplicati/manifests/client.pp +++ b/modules/duplicati/manifests/client.pp @@ -8,6 +8,8 @@ class duplicati::client { ensure => link, target => '/opt/duplicati-client/duplicati_client.py', require => Exec['checkout duplicati-client']; + '/etc/duplicati': + ensure => directory; } $duplicati_client_sha = '4f8b46a6f00dc719d84278e66b5a17939fb4a3d6' |