From 1963636a0ed9d535233e65fbb48549931d48bbb1 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 30 Dec 2024 18:50:33 +0100 Subject: [PATCH] dd --- .../mgrote_cv4pve_autosnap/tasks/systemd.yml | 31 +++++-------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/roles/mgrote_cv4pve_autosnap/tasks/systemd.yml b/roles/mgrote_cv4pve_autosnap/tasks/systemd.yml index 8ff87071..0027f875 100644 --- a/roles/mgrote_cv4pve_autosnap/tasks/systemd.yml +++ b/roles/mgrote_cv4pve_autosnap/tasks/systemd.yml @@ -1,34 +1,19 @@ --- -- name: Ensure service-unit (cv4pve) is templated +- name: Ensure systemd services are templated + become: true ansible.builtin.template: - src: cv4pve.service.j2 - dest: /etc/systemd/system/cv4pve.service + src: "{{ item }}.j2" + dest: /etc/systemd/system/{{ item }} owner: root group: root mode: "0644" no_log: "{{ no_debug | default('true') }}" notify: - systemctl daemon-reload - -- name: Ensure service-unit (mail) is templated - ansible.builtin.template: - src: cv4pve_mail.service.j2 - dest: /etc/systemd/system/cv4pve_mail.service - owner: root - group: root - mode: "0644" - notify: - - systemctl daemon-reload - -- name: Ensure service-unit (timer) is templated - ansible.builtin.template: - src: cv4pve.timer.j2 - dest: /etc/systemd/system/cv4pve.timer - owner: root - group: root - mode: "0644" - notify: - - systemctl daemon-reload + loop: + - cv4pve.service + - cv4pve_mail.service + - cv4pve.timer - name: Ensure timer is started is templated ansible.builtin.systemd: