From 55787357ef4ec792292334d8d65dcdfbcc7dfe90 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 14 Jul 2026 04:41:21 +0200 Subject: [PATCH] fix(mail): defer sys-svc-mail past the service-loader preload sys-ctl-alm-email now routes its sys-svc-mail include through the service-loader list_or_shoot queue. During preload a backup provider pulls the alarm -> email -> sys-svc-mail chain in before Mailu is preloaded, so the "Mailu was preloaded" assert fired and msmtprc would render with an empty no-reply token. Queuing sys-svc-mail to the post-load pass runs it after every service (including Mailu) is preloaded and the token is minted. Co-Authored-By: Claude Opus 4.8 (1M context) --- roles/sys-ctl-alm-email/tasks/01_core.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/roles/sys-ctl-alm-email/tasks/01_core.yml b/roles/sys-ctl-alm-email/tasks/01_core.yml index ac69fc9f84..b555cb09c7 100644 --- a/roles/sys-ctl-alm-email/tasks/01_core.yml +++ b/roles/sys-ctl-alm-email/tasks/01_core.yml @@ -1,14 +1,16 @@ --- - include_tasks: utils/once/flag.yml -- name: 📂 Include dependencies +- name: 📂 Include mail dependency (queued to post-load during preload) include_role: - name: "sys-svc-mail" + name: sys-service-loader + tasks_from: list_or_shoot.yml + vars: + list_or_shoot_roles: + - sys-svc-mail when: not (run_once_sys_svc_mail | default(false) | bool) - include_role: name: sys-service vars: - # If the email notifier fails, trigger the Telegram notifier, - # passing the failing unit's name as the instance text. system_service_tpl_on_failure: "{{ lookup('unit_name','sys-ctl-alm-telegram@', suffix=False) }}%i.service"