From e5d5d63714a2629b7aa490be66409459733a59b9 Mon Sep 17 00:00:00 2001 From: saibotk Date: Sat, 20 Nov 2021 03:30:44 +0100 Subject: [PATCH] lvm_self_backup: Reload systemd if service changed --- roles/lvm_self_backup/handlers/main.yml | 23 +++++++++++++++++++++++ roles/lvm_self_backup/tasks/main.yml | 1 + 2 files changed, 24 insertions(+) create mode 100644 roles/lvm_self_backup/handlers/main.yml diff --git a/roles/lvm_self_backup/handlers/main.yml b/roles/lvm_self_backup/handlers/main.yml new file mode 100644 index 0000000..372bf1e --- /dev/null +++ b/roles/lvm_self_backup/handlers/main.yml @@ -0,0 +1,23 @@ +--- +# Handlers for lvm_self_backup + +# Infrastructure +# Ansible instructions to deploy the infrastructure +# Copyright (C) 2021 Saibotk +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +- name: Reload systemd config + systemd: + daemon_reload: true + become: true diff --git a/roles/lvm_self_backup/tasks/main.yml b/roles/lvm_self_backup/tasks/main.yml index 44caa9c..3be446e 100644 --- a/roles/lvm_self_backup/tasks/main.yml +++ b/roles/lvm_self_backup/tasks/main.yml @@ -65,6 +65,7 @@ with_items: - "backup-lvm.service" - "backup-lvm.timer" + notify: Reload systemd config become: true - name: Start & enable backup service timer.