Murat ÖZDEMİR 5fe57ee108 Implement: Declarative act_runner configuration and Docker integration
Migrates `act_runner` configuration from shell-generated to an Ansible-templated `config.yaml`. This enables:
- Dynamic label provisioning, including `test-runner:docker://ubuntu:22.04`.
- Explicit configuration for joining the `iklimco-net` overlay network.
- Docker socket mounting for CI/CD jobs to interact with the Docker daemon.

Updates `setup/05-test-runner-ve-deploy-onkosullari.md` and other related documentation to reflect the new automated and integrated runner setup.
2026-05-12 19:49:24 +03:00

82 lines
2.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
- name: Install deploy prerequisites
ansible.builtin.dnf:
name:
- gettext
- jq
- git
state: present
- name: Create gitea-runner system user
ansible.builtin.user:
name: gitea-runner
system: true
shell: /bin/bash
create_home: true
home: /var/lib/gitea-runner
groups: docker
append: true
- name: Download act_runner binary
ansible.builtin.get_url:
url: "https://dl.gitea.com/act_runner/{{ act_runner_version }}/act_runner-{{ act_runner_version }}-{{ act_runner_arch }}"
dest: /usr/local/bin/act_runner
mode: "0755"
owner: root
group: root
- name: Create act_runner config directory
ansible.builtin.file:
path: /etc/gitea-act-runner
state: directory
owner: gitea-runner
group: gitea-runner
mode: "0750"
- name: Deploy act_runner config
ansible.builtin.template:
src: config.yaml.j2
dest: /etc/gitea-act-runner/config.yaml
owner: gitea-runner
group: gitea-runner
mode: "0640"
notify: restart act_runner
# .runner dosyası varsa runner zaten kayıtlıdır; creates ile idempotent hale gelir.
- name: Register runner with Gitea
ansible.builtin.command:
argv:
- /usr/local/bin/act_runner
- register
- --instance
- "{{ act_runner_gitea_url }}"
- --token
- "{{ act_runner_registration_token }}"
- --no-interactive
- --name
- "{{ act_runner_name }}"
- --config
- /etc/gitea-act-runner/config.yaml
- --labels
- "{{ act_runner_labels }}"
args:
chdir: /var/lib/gitea-runner
creates: /var/lib/gitea-runner/.runner
become_user: gitea-runner
when: act_runner_registration_token | length > 0
no_log: true
- name: Deploy gitea-act-runner systemd service
ansible.builtin.template:
src: gitea-act-runner.service.j2
dest: /etc/systemd/system/gitea-act-runner.service
mode: "0644"
notify: restart act_runner
- name: Enable and start gitea-act-runner
ansible.builtin.systemd:
name: gitea-act-runner
enabled: true
state: started
daemon_reload: true