From 3d14eaaa8bca80851921fdeda112f645e4f841a9 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Mon, 11 Dec 2023 09:51:32 +0200 Subject: [PATCH] Add fix duplicates task --- manifests/init.pp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index 4a14d4f..6391fc0 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -472,6 +472,37 @@ class mastodon ( } # # Maintenance tasks + $_timer_duplicates = @("EOT") + [Unit] + Description=Mastodon - Fix duplicates + + [Timer] + OnBootSec=24min + OnUnitActiveSec=1d + Unit=mastodon_fix_duplicates.service + + [Install] + WantedBy=timers.target + | EOT + + $_service_duplicates = @("EOT") + [Service] + Type=simple + Environment='RAILS_ENV=production' 'PATH=${mastodon_home}/.rbenv/shims:${mastodon_home}/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' + ExecStart=/opt/mastodon/live/bin/tootctl maintenance fix-duplicates + + [Unit] + OnFailure=status_email_antoniodelgado@%n.service + | EOT + + systemd::timer { 'mastodon_fix_duplicates.timer': + ensure => present, + timer_content => $_timer_duplicates, + service_unit => 'mastodon_fix_duplicates.service', + service_content => $_service_duplicates, + active => true, + enable => true, + } # tootctl maintenance fix-duplicates # tootctl media remove --days 180 # tootctl media remove-orphans