From ca82f2d197589ac408557a02c7b39a9b8e29d7ec Mon Sep 17 00:00:00 2001 From: Tim Van Dyck Date: Fri, 19 Apr 2024 12:09:22 +0200 Subject: [PATCH 1/2] feat: Allow different servicetypes --- roles/systemd_timer/templates/service.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/systemd_timer/templates/service.j2 b/roles/systemd_timer/templates/service.j2 index e250eb90..5548f310 100644 --- a/roles/systemd_timer/templates/service.j2 +++ b/roles/systemd_timer/templates/service.j2 @@ -16,7 +16,7 @@ After={{ timer.after_service }} {% endif %} [Service] -Type=oneshot +Type={{ timer.type | default('oneshot') }} {% if timer.user is defined %} User={{ timer.user }} {% endif %} From a280938581d26b7a14206b3a25d6ea2b8ac234a0 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 19 Apr 2024 12:27:34 +0200 Subject: [PATCH 2/2] feat: Allow multiple exec_start statements --- roles/systemd_timer/templates/service.j2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/systemd_timer/templates/service.j2 b/roles/systemd_timer/templates/service.j2 index 5548f310..622711a4 100644 --- a/roles/systemd_timer/templates/service.j2 +++ b/roles/systemd_timer/templates/service.j2 @@ -40,7 +40,13 @@ ExecStartPre={{ item }} ExecStartPre={{ timer.exec_start_pre }} {% endif %} {% endif %} +{% if timer.exec_start is iterable and timer.exec_start is not string %} +{% for item in timer.exec_start %} +ExecStart={{ item }} +{% endfor %} +{% else %} ExecStart={{ timer.exec_start }} +{% endif %} {% if timer.exec_start_post is defined %} {% if timer.exec_start_post is iterable and timer.exec_start_post is not string %} {% for item in timer.exec_start_post %}