From ba6c16ad26aef249cd7ab1c10f7e2bd02eb46135 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Thu, 14 Apr 2022 17:26:20 +0100 Subject: [PATCH] Reload systemd after installing a service unit override If systemd_service is used to install only an override for an existing unit it is necessary to reload the systemd daemon for the override to take effect. Change-Id: I64c0203ee13b3abbc441274c9304b7103a0bb23c --- tasks/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 62080cb..8f000f3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -101,6 +101,7 @@ when: "'systemd_overrides' in item" notify: - systemd service changed + register: systemd_override_result tags: - systemd-service @@ -138,7 +139,7 @@ systemd: daemon_reload: yes when: - - (systemd_services_result is changed) or (systemd_timer_result is changed) or ('true' in systemd_socket.results | map(attribute='changed') | list ) + - (systemd_services_result is changed) or (systemd_timer_result is changed) or (systemd_override_result is changed ) or ('true' in systemd_socket.results | map(attribute='changed') | list ) - include_tasks: systemd_load.yml loop: "{{ systemd_services }}"