GRM-14: feat: add systemd template units and multi-instance Ansible support

- Add instance-scoped base data/config directories in defaults
- Create gitea-runner@.service.j2 template supporting Docker and binary modes
- Refactor service.yml to install systemd template unit instances
- Remove direct container lifecycle from docker_mode.yml (delegate to systemd)
- Add deregister.yml for runner deregistration on disable/remove
- Create lifecycle playbooks: start, stop, enable, disable, status, remove
- Update handlers, integration_test, docker_update, binary_update for template units
This commit is contained in:
Emil Simeonov
2026-06-18 22:59:04 +02:00
parent 047ee05fa1
commit e5964ca5a9
15 changed files with 285 additions and 52 deletions
@@ -4,20 +4,9 @@
changed_when: "'Downloaded newer image' in pull_result.stdout or 'Status: Downloaded' in pull_result.stdout"
register: pull_result
- name: Stop and remove existing gitea_runner container
ansible.builtin.command: docker rm -f gitea-runner-{{ runner_name }}
changed_when: remove.rc == 0
failed_when: remove.rc != 0 and 'No such container' not in remove.stderr
register: remove
- name: Run updated gitea_runner daemon container
ansible.builtin.command: >
docker run -d
--name gitea-runner-{{ runner_name }}
--restart unless-stopped
-v /var/run/docker.sock:/var/run/docker.sock
-v {{ gitea_runner_data_dir }}:/data
{{ gitea_runner_docker_image }}:{{ gitea_runner_version | regex_replace('^v', '') }} daemon
--config /data/config.yaml
register: docker_run
changed_when: docker_run.rc == 0
- name: Restart gitea-runner systemd instance
ansible.builtin.systemd:
name: "gitea-runner@{{ runner_name }}"
state: restarted
daemon_reload: true
when: systemd_available.stat.exists