diff --git a/roles/mastodon/tasks/mastodon.yml b/roles/mastodon/tasks/mastodon.yml index acc3cd3..c9025ab 100644 --- a/roles/mastodon/tasks/mastodon.yml +++ b/roles/mastodon/tasks/mastodon.yml @@ -63,12 +63,9 @@ - name: Put template scripts remote_user: mastodon ansible.builtin.template: - src: "{{ item }}.j2" - dest: "{{ mastodon_home }}/bin/{{ item }}" + src: remove_media.sh.j2 + dest: "{{ mastodon_home }}/bin/remove_media.sh" mode: "0o750" - loop: - - remove_media.sh - - remove_preview_cards.sh - name: Install services ansible.builtin.template: diff --git a/roles/mastodon/templates/remove_media.sh.j2 b/roles/mastodon/templates/remove_media.sh.j2 index d3310bf..75e8538 100644 --- a/roles/mastodon/templates/remove_media.sh.j2 +++ b/roles/mastodon/templates/remove_media.sh.j2 @@ -2,3 +2,5 @@ cd {{ mastodon_home }}/live PATH={{ mastodon_home }}/bin:{{ mastodon_home }}/.local/bin:{{ mastodon_home }}/.rbenv/plugins/ruby-build/bin:{{ mastodon_home }}/.rbenv/shims:{{ mastodon_home }}/.rbenv/bin:/usr/bin:/bin RAILS_ENV=production bin/tootctl media remove +RAILS_ENV=production bin/tootctl media remove --days=45 --prune-profiles +RAILS_ENV=production bin/tootctl preview_cards remove diff --git a/roles/mastodon/templates/remove_preview_cards.sh.j2 b/roles/mastodon/templates/remove_preview_cards.sh.j2 deleted file mode 100644 index 3fb7c0a..0000000 --- a/roles/mastodon/templates/remove_preview_cards.sh.j2 +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -cd {{ mastodon_home }}/live -PATH={{ mastodon_home }}/bin:{{ mastodon_home }}/.local/bin:{{ mastodon_home }}/.rbenv/plugins/ruby-build/bin:{{ mastodon_home }}/.rbenv/shims:{{ mastodon_home }}/.rbenv/bin:/usr/bin:/bin -RAILS_ENV=production bin/tootctl preview_cards remove diff --git a/roles/webapps/tasks/tootctl.yml b/roles/webapps/tasks/tootctl.yml index 44b9b1c..5f8e3c1 100644 --- a/roles/webapps/tasks/tootctl.yml +++ b/roles/webapps/tasks/tootctl.yml @@ -7,11 +7,3 @@ minute: "0" hour: "2" job: "{{ mastodon_home }}/bin/remove_media.sh" - -- name: Cron for preview_cards tootctl - ansible.builtin.cron: - user: mastodon - name: Mastodon tootctl preview - minute: "30" - hour: "2" - job: "{{ mastodon_home }}/bin/remove_preview_cards.sh"