32 lines
1.3 KiB
YAML
32 lines
1.3 KiB
YAML
|
|
---
|
||
|
|
- name: Reload systemd
|
||
|
|
ansible.builtin.systemd:
|
||
|
|
daemon_reload: yes
|
||
|
|
|
||
|
|
- name: Restart dind
|
||
|
|
ansible.builtin.systemd:
|
||
|
|
name: "{{ forgejo_runner_dind_service }}.service"
|
||
|
|
state: restarted
|
||
|
|
daemon_reload: yes
|
||
|
|
# In check mode the unit file was never written, so systemd has never heard
|
||
|
|
# of it and this fails on "Could not find the requested service" - an
|
||
|
|
# artefact of the dry run, not a problem with the run. Skipping it keeps
|
||
|
|
# `--check --diff` able to reach the config.yml diff, which is the part of a
|
||
|
|
# dry run worth reading.
|
||
|
|
when: not ansible_check_mode
|
||
|
|
|
||
|
|
# The role had no handlers at all before, because it managed no config: the
|
||
|
|
# runner's config.yml was generated once on first deploy and never touched
|
||
|
|
# again, so there was nothing a change could need to restart. Now that
|
||
|
|
# config.yml is a template, a change to it that did NOT restart the runner
|
||
|
|
# would be the worst of both - the file on disk right and the running process
|
||
|
|
# still on the old settings. That failure mode has bitten this repo before.
|
||
|
|
#
|
||
|
|
# Note the runner's shutdown_timeout is 3h: a restart while a job is in flight
|
||
|
|
# waits for it, up to systemd's stop timeout. Deploy when the runner is idle.
|
||
|
|
- name: Restart forgejo-runner
|
||
|
|
ansible.builtin.systemd:
|
||
|
|
name: forgejo-runner
|
||
|
|
state: restarted
|
||
|
|
daemon_reload: yes
|