mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-26 21:45:20 +02:00
Introduced custom filter plugin to render optional systemd directives, refactored template to loop over directives, and adjusted default vars (TimeoutStartSec, RuntimeMaxSec handling). Details: see ChatGPT conversation https://chatgpt.com/share/68a5a730-6344-800f-b9a3-dc62d5902e9b
15 lines
501 B
Django/Jinja
15 lines
501 B
Django/Jinja
[Unit]
|
|
Description={{ SOFTWARE_NAME }} - Service for role '{{ system_service_id }}'
|
|
{{- system_service_tpl_on_failure | systemd_directive('OnFailure') }}
|
|
|
|
[Service]
|
|
Type={{ system_service_tpl_type }}
|
|
{%- for key, val in [
|
|
('TimeoutStartSec', system_service_tpl_timeout_start_sec),
|
|
('ExecStartPre', system_service_tpl_exec_start_pre),
|
|
('ExecStart', system_service_tpl_exec_start),
|
|
('RuntimeMaxSec', system_service_tpl_runtime)
|
|
] -%}
|
|
{{- val | systemd_directive(key) }}
|
|
{%- endfor %}
|