add local runner mfanyakazi to gitea

This commit is contained in:
Ibrahim Mkusa 2024-11-05 14:47:02 -05:00
parent f8bca9ea32
commit 8337a14161
3 changed files with 30 additions and 8 deletions

View File

@ -4,6 +4,7 @@
become: true
vars_files:
- ../../vars/secrets.yml
- ../../vars/vars.yml
vars:
postgresql_user: gitea
postgresql_db: giteadb
@ -159,8 +160,8 @@
src: /home/ubuntu/hifadhi_kuu/gitea/act_runner-0.2.11-linux-amd64
remote_src: true
dest: /usr/local/bin/act_runner
owner: ansible
mode: '0744'
owner: git
mode: '0755'
- name: configure the gitea action runner non-interactively
ansible.builtin.shell:
@ -173,9 +174,13 @@
args:
chdir: /home/ubuntu/hifadhi_kuu/gitea
- name: start the act_runner daemon
ansible.builtin.shell:
cmd: |
act_runner daemon
args:
chdir: /home/ubuntu/hifadhi_kuu/gitea
- name: install the act_runner systemd service
ansible.builtin.template:
src: ../../templates/act_runner.service.j2
dest: /etc/systemd/system/act_runner.service
- name: start the gitea action service
service:
name: act_runner
state: restarted
enabled: true

View File

@ -0,0 +1,15 @@
[Unit]
Description=Gitea Actions runner
Documentation=https://gitea.com/gitea/act_runner
After=docker.service
[Service]
ExecStart=/usr/local/bin/act_runner daemon
ExecReload=/bin/kill -s HUP $MAINPID
WorkingDirectory={{gitea_action_dir}}
TimeoutSec=0
RestartSec=10
Restart=always
[Install]
WantedBy=multi-user.target

2
vars/vars.yml Normal file
View File

@ -0,0 +1,2 @@
---
gitea_action_dir: /home/ubuntu/hifadhi_kuu/gitea/