From 51c14ddaf4f39e2fd18724a3e296ba1c8611a5ab Mon Sep 17 00:00:00 2001
From: Evangelos Foutras <evangelos@foutrelis.com>
Date: Thu, 22 Dec 2022 21:29:33 +0200
Subject: [PATCH] archwiki: restart archwiki-runjobs-wait on upgrade

This fixes the unexpanded magic words in mails that we sometimes see.
---
 roles/archwiki/handlers/main.yml | 3 +++
 roles/archwiki/tasks/main.yml    | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/roles/archwiki/handlers/main.yml b/roles/archwiki/handlers/main.yml
index 88ddedf18..a84ec4253 100644
--- a/roles/archwiki/handlers/main.yml
+++ b/roles/archwiki/handlers/main.yml
@@ -6,6 +6,9 @@
   become: true
   become_user: "{{ archwiki_user }}"
 
+- name: Restart archwiki-runjobs-wait
+  service: name=archwiki-runjobs-wait state=restarted
+
 # The nginx proxy/fastcgi cache can be cleared by simply deleting all files in
 # the cache directory. It is important to keep the directory tree intact,
 # otherwise nginx will spit errors into the log until it is restarted (even
diff --git a/roles/archwiki/tasks/main.yml b/roles/archwiki/tasks/main.yml
index bcf8377c9..ae996ecbc 100644
--- a/roles/archwiki/tasks/main.yml
+++ b/roles/archwiki/tasks/main.yml
@@ -56,6 +56,9 @@
   become_user: "{{ archwiki_user }}"
   notify:
     - Run wiki updatescript
+    # archwiki updates often break magic words in mails, leaving them
+    # unexpanded until the archwiki-runjobs-wait service is restarted
+    - Restart archwiki-runjobs-wait
     # purge the nginx cache and MediaWiki file cache to make sure clients get updated assets
     # as well as freshly rendered pages using the new assets
     - Purge nginx cache
-- 
GitLab