Mastodon Maintenance Role¶
Installs a systemd timer and service to run Mastodon tootctl maintenance commands (media cleanup, preview-card pruning, account pruning) using the configured runtime and .env.production.
Usage¶
- hosts: mastodon
become: true
roles:
- role: local.ops_library.mastodon_maintenance
vars:
mastodon_maintenance_on_calendar: "*-*-* 03:00:00"
mastodon_maintenance_media_days: 4
mastodon_maintenance_preview_days: 4
mastodon_maintenance_status_days: 4
To extend or replace the command list:
mastodon_maintenance_tootctl_commands:
- "media remove --days 7"
- "media remove-orphans"
mastodon_maintenance_extra_commands:
- "accounts prune"
Key Variables¶
Variable |
Default |
Description |
|---|---|---|
|
|
systemd |
|
|
Run missed timers on boot when |
|
|
Optional randomized delay for timer execution. |
|
|
Enable the systemd timer. |
|
list |
Base list of |
|
|
Extra |
|
|
Run the maintenance script immediately after installation. |
|
|
Continue on failures when set to |
See defaults/main.yml and roles/mastodon_shared/defaults/main.yml for the full reference.
Dependencies¶
local.ops_library.mastodon_shared
Testing¶
cd /path/to/ops-library
just test-role mastodon_maintenance
License¶
MIT