diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-03-26 22:34:46 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-03-26 22:34:46 -0400 |
commit | cef5a0ed716509085d113999fbc419998330e3d2 (patch) | |
tree | 4215c36a8376480a7ef962816500262c162eb3bb | |
parent | 2a49dab1adc1fa2b744041272e8a6b8fd07440cf (diff) | |
download | puppet-tozt-cef5a0ed716509085d113999fbc419998330e3d2.tar.gz puppet-tozt-cef5a0ed716509085d113999fbc419998330e3d2.zip |
more things to remove
21 files changed, 0 insertions, 567 deletions
diff --git a/modules/mail/files/munin-plugin-conf b/modules/mail/files/munin-plugin-conf deleted file mode 100644 index 547c220..0000000 --- a/modules/mail/files/munin-plugin-conf +++ /dev/null @@ -1,14 +0,0 @@ -[fail2ban] -user root - -[tarsnap] -user root - -[tarsnap_last_run] -user root - -[package_updates] -user root - -[mail_count] -user root diff --git a/modules/mail/manifests/monitoring.pp b/modules/mail/manifests/monitoring.pp index 1f0f37a..fa82a38 100644 --- a/modules/mail/manifests/monitoring.pp +++ b/modules/mail/manifests/monitoring.pp @@ -4,7 +4,6 @@ class mail::monitoring { class { [ "tick::client::plugin::fail2ban", - "tick::client::plugin::tarsnap", ]: } } diff --git a/modules/mail/templates/duplicati-mail.json b/modules/mail/templates/duplicati-mail.json deleted file mode 100644 index 3264374..0000000 --- a/modules/mail/templates/duplicati-mail.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "CreatedByVersion": "2.0.4.4", - "Schedule": { - "ID": 1, - "Tags": [ - "ID=1" - ], - "Time": "2018-11-19T18:00:00Z", - "Repeat": "1D", - "LastRun": "0001-01-01T00:00:00Z", - "Rule": "AllowedWeekDays=Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", - "AllowedDays": [ - "mon", - "tue", - "wed", - "thu", - "fri", - "sat", - "sun" - ] - }, - "Backup": { - "ID": "1", - "Name": "mail", - "Description": "", - "Tags": [], - "TargetURL": "<%= @url %>", - "DBPath": "/media/persistent/duplicati/mail.sqlite", - "Sources": [ - "/media/persistent/", - "/home/", - "/etc/" - ], - "Settings": [ - { - "Filter": "", - "Name": "encryption-module", - "Value": "aes", - "Argument": null - }, - { - "Filter": "", - "Name": "compression-module", - "Value": "zip", - "Argument": null - }, - { - "Filter": "", - "Name": "dblock-size", - "Value": "50mb", - "Argument": null - }, - { - "Filter": "", - "Name": "passphrase", - "Value": "<%= @encrypt_passphrase %>", - "Argument": null - }, - { - "Filter": "", - "Name": "retention-policy", - "Value": "1W:1D,4W:1W,12M:1M", - "Argument": null - } - ], - "Filters": [ - { - "Order": 0, - "Include": false, - "Expression": "/media/persistent/duplicati/" - } - ], - "Metadata": {}, - "IsTemporary": false - }, - "DisplayNames": { - "/media/persistent/": "persistent", - "/home/": "home", - "/etc/": "etc" - } -} diff --git a/modules/partofme/files/munin-plugin-conf b/modules/partofme/files/munin-plugin-conf deleted file mode 100644 index ef4fe98..0000000 --- a/modules/partofme/files/munin-plugin-conf +++ /dev/null @@ -1,6 +0,0 @@ -[smart_*] -user root -group disk - -[package_updates] -user root diff --git a/modules/partofme/files/sshd_config.duplicati b/modules/partofme/files/sshd_config.duplicati deleted file mode 100644 index 52a33fe..0000000 --- a/modules/partofme/files/sshd_config.duplicati +++ /dev/null @@ -1,7 +0,0 @@ -Match User duplicati - ChrootDirectory %h - ForceCommand internal-sftp - AllowTcpForwarding no - X11Forwarding no - -# vim:ft=sshdconfig diff --git a/modules/partofme/templates/duplicati-partofme-cloud.json b/modules/partofme/templates/duplicati-partofme-cloud.json deleted file mode 100644 index 64d2921..0000000 --- a/modules/partofme/templates/duplicati-partofme-cloud.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "CreatedByVersion": "2.0.4.4", - "Schedule": { - "ID": 2, - "Tags": [ - "ID=5" - ], - "Time": "2018-11-19T18:00:00Z", - "Repeat": "1D", - "LastRun": "0001-01-01T05:00:00Z", - "Rule": "AllowedWeekDays=Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", - "AllowedDays": [ - "mon", - "tue", - "wed", - "thu", - "fri", - "sat", - "sun" - ] - }, - "Backup": { - "ID": "5", - "Name": "partofme-cloud", - "Description": "", - "Tags": [], - "TargetURL": "<%= @cloud_url %>", - "DBPath": "/root/.config/Duplicati/80677580908767887373.sqlite", - "Sources": [ - "/media/persistent/crypt/", - "/media/persistent/media/", - "/media/persistent/systems/" - ], - "Settings": [ - { - "Filter": "", - "Name": "encryption-module", - "Value": "aes", - "Argument": null - }, - { - "Filter": "", - "Name": "compression-module", - "Value": "zip", - "Argument": null - }, - { - "Filter": "", - "Name": "dblock-size", - "Value": "50mb", - "Argument": null - }, - { - "Filter": "", - "Name": "passphrase", - "Value": "<%= @cloud_encrypt_passphrase %>", - "Argument": null - }, - { - "Filter": "", - "Name": "retention-policy", - "Value": "1W:1D,4W:1W,12M:1M", - "Argument": null - } - ], - "Filters": [], - "Metadata": {}, - "IsTemporary": false - }, - "DisplayNames": { - "/media/persistent/crypt/": "crypt", - "/media/persistent/media/": "media", - "/media/persistent/systems/": "systems" - } -} diff --git a/modules/partofme/templates/duplicati-partofme.json b/modules/partofme/templates/duplicati-partofme.json deleted file mode 100644 index b0fae06..0000000 --- a/modules/partofme/templates/duplicati-partofme.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "CreatedByVersion": "2.0.4.4", - "Schedule": { - "ID": 1, - "Tags": [ - "ID=1" - ], - "Time": "2018-11-19T18:00:00Z", - "Repeat": "1D", - "LastRun": "0001-01-01T05:00:00Z", - "Rule": "AllowedWeekDays=Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", - "AllowedDays": [ - "mon", - "tue", - "wed", - "thu", - "fri", - "sat", - "sun" - ] - }, - "Backup": { - "ID": "1", - "Name": "partofme", - "Description": "", - "Tags": [], - "TargetURL": "file:///media/persistent/duplicati/backups/partofme", - "DBPath": "/media/persistent/duplicati/.config/Duplicati/90657175837370896667.sqlite", - "Sources": [ - "/etc/", - "/home/" - ], - "Settings": [ - { - "Filter": "", - "Name": "encryption-module", - "Value": "aes", - "Argument": null - }, - { - "Filter": "", - "Name": "compression-module", - "Value": "zip", - "Argument": null - }, - { - "Filter": "", - "Name": "dblock-size", - "Value": "50mb", - "Argument": null - }, - { - "Filter": "", - "Name": "passphrase", - "Value": "<%= @encrypt_passphrase %>", - "Argument": null - }, - { - "Filter": "", - "Name": "retention-policy", - "Value": "1W:1D,4W:1W,12M:1M", - "Argument": null - } - ], - "Filters": [], - "Metadata": {}, - "IsTemporary": false - }, - "DisplayNames": { - "/etc/": "etc", - "/home/": "home" - } -} diff --git a/modules/tick/files/plugins/duplicati b/modules/tick/files/plugins/duplicati deleted file mode 100644 index 7b0487b..0000000 --- a/modules/tick/files/plugins/duplicati +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env ruby - -require 'date' -require 'yaml' - -def parse_duration(dur) - hours, minutes, seconds = dur.split(/:/) - 3600 * hours.to_f + 60 * minutes.to_f + seconds.to_f -end - -def field_name(name) - name.gsub(/\A[^A-Za-z_]/, '_').gsub(/[^A-Za-z0-9_]/, '_') -end - -def backup_metadata(id) - backup = YAML.load(%x{duplicati-client describe backup #{id}}) - backup[0]['Backup']['Metadata'] -end - -def all_backups - _ = %x{duplicati-client login} - backups = YAML.load(%x{duplicati-client list backups}) - ret = {} - backups.each do |backup| - name = backup.keys[0] - id = backup[name]['ID'] - ret[id] = name - end - ret -end - -now = Time.now -all_backups.each do |id, name| - metadata = backup_metadata(id) - - ago_s = now - DateTime.iso8601(metadata['LastBackupFinished']).to_time - dur_s = parse_duration(metadata['LastBackupDuration']) - file_size_b = metadata['SourceFilesSize'].to_i - file_count_n = metadata['SourceFilesCount'].to_i - - puts "duplicati,id=#{id},name=#{name} days_since_last_run=#{ago_s / 60.0 / 60.0 / 24.0},last_run_duration_minutes=#{dur_s / 60.0},file_size=#{file_size_b}i,file_count=#{file_count_n}i" -end diff --git a/modules/tick/files/plugins/duplicati.conf b/modules/tick/files/plugins/duplicati.conf deleted file mode 100644 index e6504aa..0000000 --- a/modules/tick/files/plugins/duplicati.conf +++ /dev/null @@ -1,5 +0,0 @@ -[[inputs.exec]] -commands = ["/etc/telegraf/plugins/duplicati"] -data_format = "influx" -interval = "5m" -timeout = "2m" diff --git a/modules/tick/files/plugins/tarsnap b/modules/tick/files/plugins/tarsnap deleted file mode 100644 index 0352cdb..0000000 --- a/modules/tick/files/plugins/tarsnap +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env ruby - -require 'date' - -def parse_archive(archive) - # tozt-daily-2018-12-31_03:34:13-homedoypass - m = archive.match(/ - \A - (?<host>[a-z]+) # tozt - - - (?<period>[a-z]+) # daily - - - (?<year>[0-9]+) # 2018 - - - (?<month>[0-9]+) # 12 - - - (?<day>[0-9]+) # 31 - _ - (?<hour>[0-9]+) # 03 - : - (?<minute>[0-9]+) # 34 - : - (?<second>[0-9]+) # 13 - - - (?<name>[a-z_]+) # homedoypass - \z - /x) - raise "failed to parse archive name '#{archive}'" if m.nil? - - parsed = m.names.zip(m.captures).to_h - parsed["time"] = Time.new( - m["year"], - m["month"], - m["day"], - m["hour"], - m["minute"], - m["second"] - ) - parsed -end - -archives = %x(sudo tarsnap --list-archives) - .lines - .map(&:chomp) - .map{|s| parse_archive(s)} - -now = Time.now -most_recent_since = {} -archives.each do |archive| - name = archive["name"] - since = now - archive["time"] - - if most_recent_since[name].nil? || since < most_recent_since[name] - most_recent_since[name] = since - end -end - -stats = %x(sudo tarsnap --print-stats) -bytes = stats.chomp.match(/(\d+)\z/).to_s.to_i - -most_recent_since.sort.each do |name, since| - puts "tarsnap,name=#{name} days_since_last_run=#{since.to_f / 60.0 / 60.0 / 24.0}" -end -puts "tarsnap file_size=#{bytes}i" diff --git a/modules/tick/files/plugins/tarsnap.conf b/modules/tick/files/plugins/tarsnap.conf deleted file mode 100644 index 49b8907..0000000 --- a/modules/tick/files/plugins/tarsnap.conf +++ /dev/null @@ -1,5 +0,0 @@ -[[inputs.exec]] -commands = ["/etc/telegraf/plugins/tarsnap"] -data_format = "influx" -interval = "5m" -timeout = "2m" diff --git a/modules/tick/files/plugins/tarsnap.sudoers b/modules/tick/files/plugins/tarsnap.sudoers deleted file mode 100644 index d915bf8..0000000 --- a/modules/tick/files/plugins/tarsnap.sudoers +++ /dev/null @@ -1,3 +0,0 @@ -Cmnd_Alias TARSNAP = /usr/bin/tarsnap -telegraf ALL=(ALL) NOPASSWD: TARSNAP -Defaults!TARSNAP !logfile, !syslog, !pam_session diff --git a/modules/tick/manifests/client/base_plugins.pp b/modules/tick/manifests/client/base_plugins.pp index 4a9c4df..ffd815f 100644 --- a/modules/tick/manifests/client/base_plugins.pp +++ b/modules/tick/manifests/client/base_plugins.pp @@ -32,7 +32,6 @@ class tick::client::base_plugins { class { [ - "tick::client::plugin::duplicati", "tick::client::plugin::godwrap", "tick::client::plugin::pacman", ]: diff --git a/modules/tick/manifests/client/plugin/duplicati.pp b/modules/tick/manifests/client/plugin/duplicati.pp deleted file mode 100644 index ff7e21b..0000000 --- a/modules/tick/manifests/client/plugin/duplicati.pp +++ /dev/null @@ -1,15 +0,0 @@ -class tick::client::plugin::duplicati { - file { - "/etc/telegraf/telegraf.d/duplicati.conf": - source => 'puppet:///modules/tick/plugins/duplicati.conf', - require => [ - File["/etc/telegraf/telegraf.d"], - File["/etc/telegraf/plugins/duplicati"], - ], - notify => Service["telegraf"]; - "/etc/telegraf/plugins/duplicati": - source => 'puppet:///modules/tick/plugins/duplicati', - mode => '0755', - require => File['/etc/telegraf/plugins']; - } -} diff --git a/modules/tick/manifests/client/plugin/tarsnap.pp b/modules/tick/manifests/client/plugin/tarsnap.pp deleted file mode 100644 index e7b0a5b..0000000 --- a/modules/tick/manifests/client/plugin/tarsnap.pp +++ /dev/null @@ -1,18 +0,0 @@ -class tick::client::plugin::tarsnap { - file { - "/etc/telegraf/telegraf.d/tarsnap.conf": - source => 'puppet:///modules/tick/plugins/tarsnap.conf', - require => [ - File["/etc/telegraf/telegraf.d"], - File["/etc/telegraf/plugins/tarsnap"], - ], - notify => Service["telegraf"]; - "/etc/telegraf/plugins/tarsnap": - source => 'puppet:///modules/tick/plugins/tarsnap', - mode => '0755', - require => File['/etc/telegraf/plugins']; - "/etc/sudoers.d/telegraf-tarsnap": - source => 'puppet:///modules/tick/plugins/tarsnap.sudoers', - require => Package['sudo']; - } -} diff --git a/modules/tozt/files/acts.conf b/modules/tozt/files/acts.conf deleted file mode 100644 index ddc9f15..0000000 --- a/modules/tozt/files/acts.conf +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -backuptargets="home/doy/pass home/doy/paste home/doy/public_html" -tarsnapbackupoptions="-H" diff --git a/modules/tozt/files/kapacitor/duplicati.tick b/modules/tozt/files/kapacitor/duplicati.tick deleted file mode 100644 index 5ef1c6b..0000000 --- a/modules/tozt/files/kapacitor/duplicati.tick +++ /dev/null @@ -1,28 +0,0 @@ -dbrp "telegraf"."autogen" - -var message = ''' -{{- if eq .Level "OK" -}} -backup target {{ index .Tags "name" }} is back to running -{{- else -}} -backup target {{ index .Tags "name" }} hasn't run for a while -{{- end -}} -''' - -var details = ''' -{{- if eq .Level "OK" -}} -backup target {{ index .Tags "name" }} is now {{ index .Fields "days_since_last_run" }} days since its last run -{{- else -}} -backup target {{ index .Tags "name" }} hasn't run for {{ index .Fields "days_since_last_run" }} days -{{- end -}} -''' - -stream -|from() - .measurement('duplicati') - .groupBy('name') -|min('days_since_last_run') - .as('days_since_last_run') -|alert() - .crit(lambda: "days_since_last_run" > 2) - .message(message) - .details(details) diff --git a/modules/tozt/files/kapacitor/tarsnap.tick b/modules/tozt/files/kapacitor/tarsnap.tick deleted file mode 100644 index 1239c69..0000000 --- a/modules/tozt/files/kapacitor/tarsnap.tick +++ /dev/null @@ -1,28 +0,0 @@ -dbrp "telegraf"."autogen" - -var message = ''' -{{- if eq .Level "OK" -}} -backup target {{ index .Tags "name" }} is back to running -{{- else -}} -backup target {{ index .Tags "name" }} hasn't run for a while -{{- end -}} -''' - -var details = ''' -{{- if eq .Level "OK" -}} -backup target {{ index .Tags "name" }} is now {{ index .Fields "days_since_last_run" }} days since its last run -{{- else -}} -backup target {{ index .Tags "name" }} hasn't run for {{ index .Fields "days_since_last_run" }} days -{{- end -}} -''' - -stream -|from() - .measurement('tarsnap') - .groupBy('name') -|min('days_since_last_run') - .as('days_since_last_run') -|alert() - .crit(lambda: "days_since_last_run" > 2) - .message(message) - .details(details) diff --git a/modules/tozt/files/munin-plugin-conf b/modules/tozt/files/munin-plugin-conf deleted file mode 100644 index acc7bdc..0000000 --- a/modules/tozt/files/munin-plugin-conf +++ /dev/null @@ -1,15 +0,0 @@ -[fail2ban] -user root - -[tarsnap] -user root - -[tarsnap_last_run] -user root - -[package_updates] -user root - -[certbot] -user root -env.CERTBOT_CONFIG_DIR /media/persistent/certbot diff --git a/modules/tozt/manifests/monitoring.pp b/modules/tozt/manifests/monitoring.pp index 2007ab2..cafa705 100644 --- a/modules/tozt/manifests/monitoring.pp +++ b/modules/tozt/manifests/monitoring.pp @@ -11,7 +11,6 @@ class tozt::monitoring { [ "tick::client::plugin::certbot", "tick::client::plugin::fail2ban", - "tick::client::plugin::tarsnap", ]: } } diff --git a/modules/tozt/templates/duplicati-tozt.json b/modules/tozt/templates/duplicati-tozt.json deleted file mode 100644 index e6ce95b..0000000 --- a/modules/tozt/templates/duplicati-tozt.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "CreatedByVersion": "2.0.4.4", - "Schedule": { - "ID": 1, - "Tags": [ - "ID=1" - ], - "Time": "2018-11-19T18:00:00Z", - "Repeat": "1D", - "LastRun": "0001-01-01T00:00:00Z", - "Rule": "AllowedWeekDays=Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", - "AllowedDays": [ - "mon", - "tue", - "wed", - "thu", - "fri", - "sat", - "sun" - ] - }, - "Backup": { - "ID": "1", - "Name": "tozt", - "Description": "", - "Tags": [], - "TargetURL": "<%= @url %>", - "DBPath": "/media/persistent/duplicati/tozt.sqlite", - "Sources": [ - "/media/persistent/", - "/home/", - "/etc/" - ], - "Settings": [ - { - "Filter": "", - "Name": "encryption-module", - "Value": "aes", - "Argument": null - }, - { - "Filter": "", - "Name": "compression-module", - "Value": "zip", - "Argument": null - }, - { - "Filter": "", - "Name": "dblock-size", - "Value": "50mb", - "Argument": null - }, - { - "Filter": "", - "Name": "passphrase", - "Value": "<%= @encrypt_passphrase %>", - "Argument": null - }, - { - "Filter": "", - "Name": "retention-policy", - "Value": "1W:1D,4W:1W,12M:1M", - "Argument": null - } - ], - "Filters": [ - { - "Order": 0, - "Include": false, - "Expression": "/media/persistent/duplicati/" - } - ], - "Metadata": {}, - "IsTemporary": false - }, - "DisplayNames": { - "/media/persistent/": "persistent", - "/home/": "home", - "/etc/": "etc" - } -} |