# MANAGED BY ANSIBLE - roles/forgejo_runner [Unit] Description=Forgejo Runner Documentation=https://forgejo.org/docs/latest/admin/actions/ {% if forgejo_runner_dind_enabled %} # forgejo-dind is a hard dependency, not a nicety. With an explicit # container.docker_host the runner does not fall back to anything: if that # daemon is not answering, every job it picks up fails to create its container. # Requires= also means a stopped dind stops the runner, so the failure is one # red unit rather than a runner that looks healthy and fails every job. # # The dind unit stays in "activating" until its daemon answers, so After= here # really does mean "after Docker is usable", not just "after the process # forked". After=docker.service {{ forgejo_runner_dind_service }}.service Requires=docker.service {{ forgejo_runner_dind_service }}.service {% else %} After=docker.service Requires=docker.service {% endif %} [Service] Type=simple User={{ forgejo_runner_user }} Group={{ forgejo_runner_user }} WorkingDirectory={{ forgejo_runner_dir }} ExecStart={{ forgejo_runner_bin_path }} daemon --config {{ forgejo_runner_config_path }} Restart=on-failure RestartSec=10 [Install] WantedBy=multi-user.target