personal_infra/ansible/roles/backup_source/templates/backup.service.j2
2026-09-12 16:02:00 +02:00

14 lines
532 B
Django/Jinja

[Unit]
Description={{ backup_source_description }} backup
{% if backup_source_stop_service %}
{# systemd rejects a bare name here ("Failed to add dependency ... Invalid
argument"), so normalise to a full unit name. #}
After={{ backup_source_stop_service if '.' in backup_source_stop_service else backup_source_stop_service ~ '.service' }}
{% endif %}
[Service]
Type=oneshot
ExecStart=/usr/local/bin/{{ backup_source_name }}-backup.sh
StandardOutput=journal
StandardError=journal
SyslogIdentifier={{ backup_source_name }}-backup