summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-03-26 02:56:54 -0400
committerJesse Luehrs <doy@tozt.net>2021-03-26 02:56:54 -0400
commit2a49dab1adc1fa2b744041272e8a6b8fd07440cf (patch)
tree03db6a8d589921c745ae2b0575cd71b3a94a5e6a
parentf81b920c9e1405d9e40ae912a225c2d44c93ed68 (diff)
downloadpuppet-tozt-2a49dab1adc1fa2b744041272e8a6b8fd07440cf.tar.gz
puppet-tozt-2a49dab1adc1fa2b744041272e8a6b8fd07440cf.zip
stop using tarsnap and duplicati
-rw-r--r--modules/duplicati/files/override.conf3
-rw-r--r--modules/duplicati/manifests/backup.pp19
-rw-r--r--modules/duplicati/manifests/client.pp45
-rw-r--r--modules/duplicati/manifests/init.pp4
-rw-r--r--modules/duplicati/manifests/server.pp29
-rw-r--r--modules/mail/manifests/backups.pp10
-rw-r--r--modules/partofme/manifests/backups.pp39
-rw-r--r--modules/tarsnap/files/acts5
-rw-r--r--modules/tarsnap/files/tarsnap.conf5
-rw-r--r--modules/tarsnap/manifests/init.pp31
-rw-r--r--modules/tozt/manifests/backups.pp10
11 files changed, 0 insertions, 200 deletions
diff --git a/modules/duplicati/files/override.conf b/modules/duplicati/files/override.conf
deleted file mode 100644
index d1b8401..0000000
--- a/modules/duplicati/files/override.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-[Service]
-User=root
-Group=root
diff --git a/modules/duplicati/manifests/backup.pp b/modules/duplicati/manifests/backup.pp
deleted file mode 100644
index 8a140f3..0000000
--- a/modules/duplicati/manifests/backup.pp
+++ /dev/null
@@ -1,19 +0,0 @@
-define duplicati::backup($content) {
- include duplicati
-
- file { "/etc/duplicati/$name.json":
- content => $content,
- mode => '0600',
- require => File['/etc/duplicati'];
- }
-
- exec { "load backup for $name":
- provider => shell,
- command => "duplicati-client login && duplicati-client create backup /etc/duplicati/$name.json",
- unless => "duplicati-client login && 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
deleted file mode 100644
index ff4c5e4..0000000
--- a/modules/duplicati/manifests/client.pp
+++ /dev/null
@@ -1,45 +0,0 @@
-class duplicati::client {
- package { ['python-yaml', 'python-dateutil', 'python-requests']:
- ensure => installed;
- }
-
- file {
- '/usr/local/bin/duplicati-client':
- ensure => link,
- target => '/opt/duplicati-client/duplicati_client.py',
- require => Exec['checkout duplicati-client'];
- '/etc/duplicati':
- ensure => directory,
- recurse => true,
- purge => true;
- }
-
- # patch branch for now until this lands
- $duplicati_client_sha = '0b5e29d43d0b25cd25c2f3877ea377a2d858c296'
- exec { 'clone duplicati-client':
- # command => '/usr/bin/git clone git://github.com/Pectojin/duplicati-client',
- command => '/usr/bin/git clone git://github.com/doy/duplicati-client',
- cwd => '/opt',
- creates => '/opt/duplicati-client/.git';
- }
-
- exec { 'checkout duplicati-client':
- provider => shell,
- command => "/usr/bin/git fetch && /usr/bin/git checkout $duplicati_client_sha",
- unless => "test \"\$(git rev-parse @)\" = \"$duplicati_client_sha\"",
- cwd => '/opt/duplicati-client',
- require => Exec['clone duplicati-client'];
- }
-
- exec { 'duplicati-client login':
- command => '/usr/local/bin/duplicati-client login',
- creates => '/root/.config/duplicati-client/config.yml',
- tries => 3,
- try_sleep => 10,
- require => [
- File['/usr/local/bin/duplicati-client'],
- Exec['checkout duplicati-client'],
- Service['duplicati'],
- ]
- }
-}
diff --git a/modules/duplicati/manifests/init.pp b/modules/duplicati/manifests/init.pp
deleted file mode 100644
index 2caf0e4..0000000
--- a/modules/duplicati/manifests/init.pp
+++ /dev/null
@@ -1,4 +0,0 @@
-class duplicati {
- contain duplicati::server
- contain duplicati::client
-}
diff --git a/modules/duplicati/manifests/server.pp b/modules/duplicati/manifests/server.pp
deleted file mode 100644
index 112c7dd..0000000
--- a/modules/duplicati/manifests/server.pp
+++ /dev/null
@@ -1,29 +0,0 @@
-class duplicati::server {
- package {
- [
- "gtk-sharp-2",
- "mono",
- ]:
- ensure => installed,
- install_options => ["--asdeps"];
- }
-
- package::makepkg { 'duplicati-latest':
- ensure => installed,
- require => [
- Package['gtk-sharp-2'],
- Package['mono'],
- ]
- }
-
- systemd::override { "duplicati":
- source => 'puppet:///modules/duplicati/override.conf';
- }
-
- service { 'duplicati':
- ensure => running,
- enable => true,
- subscribe => Systemd::Override['duplicati'],
- require => Package::Makepkg['duplicati-latest'];
- }
-}
diff --git a/modules/mail/manifests/backups.pp b/modules/mail/manifests/backups.pp
index 3f40ad8..23983be 100644
--- a/modules/mail/manifests/backups.pp
+++ b/modules/mail/manifests/backups.pp
@@ -1,14 +1,4 @@
class mail::backups {
- class { "tarsnap":
- source => "puppet:///modules/mail/acts.conf";
- }
-
- $encrypt_passphrase = secret::value('duplicati-encrypt')
- $url = secret::value('duplicati-url')
- duplicati::backup { 'mail':
- content => template('mail/duplicati-mail.json');
- }
-
class { 'borgmatic':
extra_paths => ['/media/persistent'];
}
diff --git a/modules/partofme/manifests/backups.pp b/modules/partofme/manifests/backups.pp
index 81b876b..d66565f 100644
--- a/modules/partofme/manifests/backups.pp
+++ b/modules/partofme/manifests/backups.pp
@@ -2,45 +2,6 @@ class partofme::backups {
syncthing::user { $::default_user:
}
- $encrypt_passphrase = secret::value('duplicati')
- duplicati::backup { "partofme":
- content => template('partofme/duplicati-partofme.json');
- }
-
- $cloud_encrypt_passphrase = secret::value('duplicati-cloud')
- $cloud_url = secret::value('duplicati-cloud-url')
- duplicati::backup { "partofme-cloud":
- content => template('partofme/duplicati-partofme-cloud.json');
- }
-
- file { '/usr/local/bin/sftp-only':
- content => 'exec false',
- mode => '0755';
- }
-
- user { 'duplicati':
- home => '/media/persistent/duplicati',
- password => secret::value('passwd/duplicati'),
- shell => '/usr/local/bin/sftp-only',
- require => [
- Package::Makepkg['duplicati-latest'],
- File['/usr/local/bin/sftp-only'],
- ];
- }
-
- sshd::configsection { 'duplicati':
- source => 'puppet:///modules/partofme/sshd_config.duplicati';
- }
-
- exec { 'allow sftp logins for duplicati':
- provider => 'shell',
- command => 'echo /usr/local/bin/sftp-only >> /etc/shells',
- unless => 'grep -qF /usr/local/bin/sftp-only /etc/shells',
- require => File['/usr/local/bin/sftp-only'];
- }
-
- #############################
-
include borg
file {
"/media/persistent/borg/.ssh/authorized_keys":
diff --git a/modules/tarsnap/files/acts b/modules/tarsnap/files/acts
deleted file mode 100644
index 7c2c3bd..0000000
--- a/modules/tarsnap/files/acts
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-set -eu
-set -o pipefail
-
-acts
diff --git a/modules/tarsnap/files/tarsnap.conf b/modules/tarsnap/files/tarsnap.conf
deleted file mode 100644
index 68f29c2..0000000
--- a/modules/tarsnap/files/tarsnap.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-cachedir /media/persistent/tarsnap-cache
-keyfile /etc/tarsnap/machine-key
-nodump
-print-stats
-checkpoint-bytes 1G
diff --git a/modules/tarsnap/manifests/init.pp b/modules/tarsnap/manifests/init.pp
deleted file mode 100644
index 485daa7..0000000
--- a/modules/tarsnap/manifests/init.pp
+++ /dev/null
@@ -1,31 +0,0 @@
-class tarsnap($source=undef, $content=undef) {
- package { 'tarsnap':
- ensure => installed;
- }
-
- package::makepkg { 'acts':
- ensure => installed,
- require => Package['tarsnap'];
- }
-
- file {
- '/etc/tarsnap/tarsnap.conf':
- source => 'puppet:///modules/tarsnap/tarsnap.conf';
- '/etc/acts.conf':
- source => $source,
- content => $content;
- }
-
- cron::job { "acts":
- frequency => "daily",
- source => 'puppet:///modules/tarsnap/acts',
- require => [
- File['/etc/acts.conf'],
- Package::Makepkg['acts'],
- ];
- }
-
- secret { "/etc/tarsnap/machine-key":
- source => 'tarsnap',
- }
-}
diff --git a/modules/tozt/manifests/backups.pp b/modules/tozt/manifests/backups.pp
index a43eaf3..44908e6 100644
--- a/modules/tozt/manifests/backups.pp
+++ b/modules/tozt/manifests/backups.pp
@@ -1,14 +1,4 @@
class tozt::backups {
- class { "tarsnap":
- source => "puppet:///modules/tozt/acts.conf";
- }
-
- $encrypt_passphrase = secret::value('duplicati-encrypt')
- $url = secret::value('duplicati-url')
- duplicati::backup { 'tozt':
- content => template('tozt/duplicati-tozt.json');
- }
-
class { 'borgmatic':
extra_paths => ['/media/persistent'],
}