Compare commits

..

2 Commits

Author SHA1 Message Date
Bastian de Byl
1c478e6ab5 fix: add ESP-IDF to git safe.directory before submodule init
Root-owned /opt/esp-idf triggers git dubious ownership check when
running submodule update. Add safe.directory config beforehand.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 17:10:25 -04:00
Bastian de Byl
dbd898cb2f feat: support multiple Gitea instances for actions runner
The gitea-actions role now uses a `gitea_runners` list instead of a
single `gitea_instance_url`. Each instance gets its own config, systemd
service, working directory, and cache. Migrates from the old single
`act_runner.service` to per-instance `act_runner-{name}.service`.

Adds git.skudak.com alongside git.debyl.io as runner targets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 17:04:23 -04:00
7 changed files with 68 additions and 26 deletions

View File

@@ -3,7 +3,16 @@ gitea_runner_user: gitea-runner
gitea_runner_home: /home/gitea-runner gitea_runner_home: /home/gitea-runner
gitea_runner_version: "0.2.13" gitea_runner_version: "0.2.13"
gitea_runner_arch: linux-amd64 gitea_runner_arch: linux-amd64
gitea_instance_url: https://git.debyl.io
# Multiple Gitea instances to run actions runners for
gitea_runners:
- name: debyl
instance_url: https://git.debyl.io
- name: skudak
instance_url: https://git.skudak.com
# Old single-instance format (replaced by gitea_runners list above):
# gitea_instance_url: https://git.debyl.io
# Paths # Paths
act_runner_bin: /usr/local/bin/act_runner act_runner_bin: /usr/local/bin/act_runner

View File

@@ -1,10 +1,11 @@
--- ---
- name: restart act_runner - name: restart act_runner services
become: true become: true
ansible.builtin.systemd: ansible.builtin.systemd:
name: act_runner name: "act_runner-{{ item.name }}"
state: restarted state: restarted
daemon_reload: true daemon_reload: true
loop: "{{ gitea_runners }}"
- name: restart podman socket - name: restart podman socket
become: true become: true

View File

@@ -35,6 +35,13 @@
when: not esp_idf_dir.stat.exists when: not esp_idf_dir.stat.exists
tags: gitea-actions tags: gitea-actions
- name: add ESP-IDF to git safe.directory
become: true
ansible.builtin.command:
cmd: git config --global --add safe.directory {{ esp_idf_path }}
changed_when: false
tags: gitea-actions
- name: ensure ESP-IDF submodules are initialized - name: ensure ESP-IDF submodules are initialized
become: true become: true
ansible.builtin.command: ansible.builtin.command:

View File

@@ -15,31 +15,36 @@
mode: "0755" mode: "0755"
tags: gitea-actions tags: gitea-actions
- name: create act_runner working directory - name: create per-runner working directory
become: true become: true
ansible.builtin.file: ansible.builtin.file:
path: "{{ act_runner_work_dir }}" path: "{{ act_runner_work_dir }}/{{ item.name }}"
state: directory state: directory
owner: "{{ gitea_runner_user }}" owner: "{{ gitea_runner_user }}"
group: "{{ gitea_runner_user }}" group: "{{ gitea_runner_user }}"
mode: "0755" mode: "0755"
loop: "{{ gitea_runners }}"
tags: gitea-actions tags: gitea-actions
- name: create act_runner cache directory - name: create per-runner cache directory
become: true become: true
ansible.builtin.file: ansible.builtin.file:
path: "{{ act_runner_work_dir }}/cache" path: "{{ act_runner_work_dir }}/{{ item.name }}/cache"
state: directory state: directory
owner: "{{ gitea_runner_user }}" owner: "{{ gitea_runner_user }}"
group: "{{ gitea_runner_user }}" group: "{{ gitea_runner_user }}"
mode: "0755" mode: "0755"
loop: "{{ gitea_runners }}"
tags: gitea-actions tags: gitea-actions
- name: deploy act_runner configuration - name: deploy per-runner configuration
become: true become: true
ansible.builtin.template: ansible.builtin.template:
src: config.yaml.j2 src: config.yaml.j2
dest: "{{ act_runner_config_dir }}/config.yaml" dest: "{{ act_runner_config_dir }}/config-{{ item.name }}.yaml"
mode: "0644" mode: "0644"
notify: restart act_runner vars:
runner_name: "{{ item.name }}"
loop: "{{ gitea_runners }}"
notify: restart act_runner services
tags: gitea-actions tags: gitea-actions

View File

@@ -1,17 +1,37 @@
--- ---
- name: deploy act_runner systemd service - name: stop and disable legacy act_runner service
become: true
ansible.builtin.template:
src: act_runner.service.j2
dest: /etc/systemd/system/act_runner.service
mode: "0644"
notify: restart act_runner
tags: gitea-actions
- name: enable act_runner service
become: true become: true
ansible.builtin.systemd: ansible.builtin.systemd:
name: act_runner name: act_runner
state: stopped
enabled: false
failed_when: false
tags: gitea-actions
- name: remove legacy act_runner service file
become: true
ansible.builtin.file:
path: /etc/systemd/system/act_runner.service
state: absent
tags: gitea-actions
- name: deploy per-runner systemd service
become: true
ansible.builtin.template:
src: act_runner.service.j2
dest: "/etc/systemd/system/act_runner-{{ item.name }}.service"
mode: "0644"
vars:
runner_name: "{{ item.name }}"
loop: "{{ gitea_runners }}"
notify: restart act_runner services
tags: gitea-actions
- name: enable per-runner services
become: true
ansible.builtin.systemd:
name: "act_runner-{{ item.name }}"
daemon_reload: true daemon_reload: true
enabled: true enabled: true
loop: "{{ gitea_runners }}"
tags: gitea-actions tags: gitea-actions

View File

@@ -1,11 +1,11 @@
[Unit] [Unit]
Description=Gitea Actions runner Description=Gitea Actions runner ({{ runner_name }})
Documentation=https://gitea.com/gitea/act_runner Documentation=https://gitea.com/gitea/act_runner
After=network.target podman.socket After=network.target podman.socket
[Service] [Service]
ExecStart={{ act_runner_bin }} daemon --config {{ act_runner_config_dir }}/config.yaml ExecStart={{ act_runner_bin }} daemon --config {{ act_runner_config_dir }}/config-{{ runner_name }}.yaml
WorkingDirectory={{ act_runner_work_dir }} WorkingDirectory={{ act_runner_work_dir }}/{{ runner_name }}
TimeoutSec=0 TimeoutSec=0
RestartSec=10 RestartSec=10
Restart=always Restart=always

View File

@@ -2,7 +2,7 @@ log:
level: info level: info
runner: runner:
file: {{ act_runner_work_dir }}/.runner file: {{ act_runner_work_dir }}/{{ runner_name }}/.runner
capacity: 1 capacity: 1
timeout: 3h timeout: 3h
insecure: false insecure: false
@@ -15,7 +15,7 @@ runner:
cache: cache:
enabled: true enabled: true
dir: {{ act_runner_work_dir }}/cache dir: {{ act_runner_work_dir }}/{{ runner_name }}/cache
container: container:
network: host network: host
@@ -27,4 +27,4 @@ container:
force_pull: false force_pull: false
host: host:
workdir_parent: {{ act_runner_work_dir }}/workdir workdir_parent: {{ act_runner_work_dir }}/{{ runner_name }}/workdir