From 7ec729d9126f3e24b95dcd11916d98c0d86a9b6e Mon Sep 17 00:00:00 2001 From: Waffles Date: Fri, 6 Jan 2023 09:32:46 -0800 Subject: [PATCH] Add a script to rebuild the feeds if redis fails --- roles/mastodon/tasks/main.yml | 10 ++++++++++ roles/mastodon/templates/feeds-build.sh.j2 | 4 ++++ 2 files changed, 14 insertions(+) create mode 100644 roles/mastodon/templates/feeds-build.sh.j2 diff --git a/roles/mastodon/tasks/main.yml b/roles/mastodon/tasks/main.yml index 5a4f706..20dfacf 100644 --- a/roles/mastodon/tasks/main.yml +++ b/roles/mastodon/tasks/main.yml @@ -39,6 +39,16 @@ dest: /home/mastodon/live/docker-compose.yml notify: "docker-compose up" +- name: Install feed rebuild script + template: + src: feeds-build.sh.j2 + dest: /usr/local/bin/feeds-build.sh + +- name: Set permission of feeds-build.sh + file: + path: /usr/local/bin/feeds-build.sh + mode: '0755' + - import_tasks: redis.yml when: ansible_hostname == REDIS_HOST diff --git a/roles/mastodon/templates/feeds-build.sh.j2 b/roles/mastodon/templates/feeds-build.sh.j2 new file mode 100644 index 0000000..46097c6 --- /dev/null +++ b/roles/mastodon/templates/feeds-build.sh.j2 @@ -0,0 +1,4 @@ +#!/bin/bash + +# If we run this from cron, remove change to "docker exec -i" as we don't have an attached terminal +docker exec -it live-web-1 bin/tootctl feeds build --all