aboutsummaryrefslogtreecommitdiffstats
path: root/roles/systemd_timer/templates/etc/systemd/system/task.service.j2
blob: 307c112653554896dd38187515c4c32afab24261 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[Unit]
Description={{ timer_description | default(timer_name) }}
{% if timer_after is defined %}
After={{ timer_after if timer_after is string else (timer_after | join(' ')) }}
{% endif %}

[Service]
Type=oneshot
User={{ timer_user }}
{% if timer_group is defined %}
Group={{ timer_group }}
{% endif %}
{% if timer_chdir is defined %}
WorkingDirectory={{ timer_chdir }}
{% endif %}
{% if timer_shell %}
ExecStart=/bin/bash -Eeu -o pipefail -c {{ timer_exec | replace('%', '%%') | replace('$', '$$') | replace('\\', '\\\\') | quote }}
{% else %}
ExecStart={{ timer_exec | replace('%', '%%') | replace(';', '\;') }}
{% endif %}

[Install]
WantedBy=multi-user.target