Files
grm/ansible/remove-runner.yml
T
Emil Simeonov e5964ca5a9 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
2026-06-18 22:59:04 +02:00

43 lines
1.4 KiB
YAML

---
- name: Remove Gitea Actions runner
hosts: all
become: true
vars: {}
tasks:
- name: Include systemd availability check
ansible.builtin.include_tasks: roles/gitea-runner/tasks/systemd_check.yml
- name: Stop gitea-runner systemd instance
ansible.builtin.systemd:
name: "gitea-runner@{{ runner_name }}"
state: stopped
daemon_reload: true
when: systemd_available.stat.exists
- name: Disable gitea-runner systemd instance
ansible.builtin.systemd:
name: "gitea-runner@{{ runner_name }}"
enabled: false
daemon_reload: true
when: systemd_available.stat.exists
- name: Include deregistration
ansible.builtin.include_tasks: roles/gitea-runner/tasks/deregister.yml
when: not skip_runner_registration | default(false)
- name: Remove systemd unit file (last instance)
ansible.builtin.file:
path: "/etc/systemd/system/gitea-runner@.service"
state: absent
when: remove_systemd_template | default(false)
- name: Remove runner data directory
ansible.builtin.file:
path: "{{ gitea_runner_data_dir | default('/var/lib/gitea-runner/' ~ runner_name) }}"
state: absent
- name: Remove runner config directory
ansible.builtin.file:
path: "{{ gitea_runner_config_dir | default('/etc/gitea-runner/' ~ runner_name) }}"
state: absent