From 1a65942f36b66b0b5bc4966da3467e869097156d Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Sat, 6 Apr 2024 14:43:40 +0300 Subject: [PATCH] Add variables for maintenance cleanup --- manifests/init.pp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 431a13b..d08793a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -70,6 +70,12 @@ # WARNING! This token will be in plain text in the System unit # definition, so restrict it to only read public repos. # +# [*media_retention_days*] +# Integer with the number of days to keep media attachments. Default 7. +# +# [*cards_retention_days*] +# Integer with the number of days to keep preview cards. Default 180. +# class mastodon ( String $ensure = 'present', String $hostname = 'mastodon.example.org', @@ -114,6 +120,8 @@ class mastodon ( String $cert_admin_mail = 'cert-admin@example.org', Boolean $manage_updater_task = false, String $github_token = '', + Integer $media_retention_days = 7, + Integer $cards_retention_days = 180, ) { case $ensure { default: { @@ -512,7 +520,7 @@ class mastodon ( User=${mastodon_user} WorkingDirectory=${mastodon_home}/live 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 media remove --days 180 + ExecStart=/opt/mastodon/live/bin/tootctl media remove --days ${media_retention_days} [Unit] OnFailure=status_email_antoniodelgado@%n.service @@ -545,7 +553,7 @@ class mastodon ( User=${mastodon_user} WorkingDirectory=${mastodon_home}/live 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 preview_cards remove --days 180 + ExecStart=/opt/mastodon/live/bin/tootctl preview_cards remove --days ${cards_retention_days} [Unit] OnFailure=status_email_antoniodelgado@%n.service