Adding gitea act_runner roles

This commit is contained in:
ml
2026-07-02 07:49:53 +02:00
parent 2ccf2c9826
commit 06afde4a87
7 changed files with 148 additions and 0 deletions
@@ -0,0 +1,7 @@
---
- name: Restart act_runner
community.docker.docker_compose_v2:
project_src: "{{ act_runner_data_dir }}"
state: present
pull: missing
recreate: always
+46
View File
@@ -0,0 +1,46 @@
---
- name: Create act_runner base directory
ansible.builtin.file:
path: "{{ act_runner_data_dir }}"
state: directory
owner: root
group: root
mode: "0755"
tags: act_runner
- name: Create per-runner data directories
ansible.builtin.file:
path: "{{ act_runner_data_dir }}/runner-{{ item }}"
state: directory
owner: root
group: root
mode: "0755"
loop: "{{ range(1, act_runner_count + 1) | list }}"
tags: act_runner
- name: Deploy act_runner config
ansible.builtin.template:
src: config.yml.j2
dest: "{{ act_runner_data_dir }}/config.yml"
owner: root
group: root
mode: "0644"
notify: Restart act_runner
tags: act_runner
- name: Deploy Docker Compose file
ansible.builtin.template:
src: docker-compose.yml.j2
dest: "{{ act_runner_data_dir }}/docker-compose.yml"
owner: root
group: root
mode: "0644"
notify: Restart act_runner
tags: act_runner
- name: Start act_runner
community.docker.docker_compose_v2:
project_src: "{{ act_runner_data_dir }}"
state: present
pull: missing
tags: act_runner
@@ -0,0 +1,21 @@
# Managed by Ansible — do not edit manually
log:
level: info
runner:
file: .runner # stored in each runner's /data volume
capacity: 1 # one concurrent job per runner container
timeout: 3h
fetch_timeout: 5s
fetch_interval: 2s
cache:
enabled: false # disable built-in cache server; use actions/cache if needed
container:
network: bridge # job containers get default bridge network with internet access
privileged: false
valid_volumes:
- /tmp
force_pull: false
force_rebuild: false
@@ -0,0 +1,17 @@
# Managed by Ansible — do not edit manually
services:
{% for i in range(1, act_runner_count + 1) %}
runner-{{ i }}:
image: gitea/act_runner:{{ act_runner_version }}
container_name: act-runner-{{ i }}
restart: unless-stopped
environment:
- GITEA_INSTANCE_URL=https://{{ domain_gitea }}
- GITEA_RUNNER_REGISTRATION_TOKEN={{ gitea_runner_registration_token }}
- GITEA_RUNNER_NAME=runner-{{ i }}
- CONFIG_FILE=/config.yml
volumes:
- {{ act_runner_data_dir }}/runner-{{ i }}:/data
- {{ act_runner_data_dir }}/config.yml:/config.yml:ro
- /var/run/docker.sock:/var/run/docker.sock
{% endfor %}