From 5c3ed1736e3f1dd07db6a267b47bccfac36904e0 Mon Sep 17 00:00:00 2001 From: hygienic-books Date: Wed, 4 Jun 2025 01:28:57 +0200 Subject: [PATCH] refactor(role): systemctl daemon-reload after copy Since unit files are now copied to '/etc/systemd/system' we should make sure that systemd sees the newest version of all unit files before we attempt to enable a timer unit. --- tasks/archlinux-auto-updates.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tasks/archlinux-auto-updates.yml b/tasks/archlinux-auto-updates.yml index 3b9c816..7d8da5e 100644 --- a/tasks/archlinux-auto-updates.yml +++ b/tasks/archlinux-auto-updates.yml @@ -54,6 +54,13 @@ notify: - 'Reload systemd unit configs' +# Chances are we've just updated systemd unit files in '/etc/systemd/system'. In +# a second we'll be enabling a timer unit that was among those files we just +# (potentially) changed. We should flush our handlers now, i.e. 'systemctl +# daemon-reload' to make sure systemd knows the newest state of our units. +- name: 'Flush handlers' + meta: flush_handlers + - name: 'If Arch Linux enable systemd timer for OS auto-upgrades' ansible.builtin.systemd_service: name: 'arch-linux-update-and-restart.timer'