[Unit]
Description=Girder
After=network.target

[Service]
User={{ girder_user | default(ansible_user_id) }}
Group={{ girder_user | default(ansible_user_id) }}
WorkingDirectory={{ girder_path }}
Restart=always
{% if girder_virtualenv is defined %}
ExecStart={{ girder_virtualenv }}/bin/python -m girder
{% else %}
ExecStart={{ girder_python | default(ansible_python.executable) }} -m girder
{% endif %}

{% if girder_hardened %}
# Hardened systemd options
ProtectSystem=full
ProtectHome=read-only
ReadWriteDirectories={{ girder_path }} -{{ ansible_user_dir }}/.girder {{ girder_virtualenv|default("") }}
{% endif %}

[Install]
WantedBy=multi-user.target
