Add gitea-runners (work in progress)

This commit is contained in:
Timo Makinen 2023-03-14 17:24:24 +00:00
parent 2ca8615351
commit a21159f158
8 changed files with 92 additions and 0 deletions

View file

@ -0,0 +1,4 @@
---
firewall_in:
- {proto: tcp, port: 22, from: [172.20.20.0/22]}
- {proto: tcp, port: 4949, from: [172.20.20.0/22]}

View file

@ -0,0 +1,6 @@
---
vmhost: vmhost02.home.foo.sh
network_interfaces:
- device: eth0
vlan: 20
mac: 52:54:00:ac:dc:7c

View file

@ -25,6 +25,11 @@ gitea:
gitea02.home.foo.sh:
vars:
gitea_version: "1.19.0-rc1"
gitearunner:
hosts:
gitea-runner02.home.foo.sh:
vars:
gitea_runner_version: "v0.0.1"
homeassistant:
hosts:
homeassistant01.home.foo.sh:
@ -146,6 +151,7 @@ rocky9:
adm:
git:
gitea:
gitearunner:
influxdb:
ldap:
mirror:

View file

@ -0,0 +1,14 @@
---
- name: Deploy KVM virtual machines
ansible.builtin.import_playbook: include/deploy-kvm-guest.yml
vars:
myhosts: gitearunner
- name: Configure instance
hosts: gitearunner
user: root
gather_facts: true
roles:
- base
- gitea_runner

View file

@ -0,0 +1,2 @@
---
gitea_runner_version: main

View file

@ -0,0 +1,7 @@
---
- name: Build act_runner
ansible.builtin.command:
argv:
- make
- build
chdir: /usr/local/src/act_runner

View file

@ -0,0 +1,4 @@
---
dependencies:
- {role: docker}
- {role: git}

View file

@ -0,0 +1,49 @@
---
- name: Create group
ansible.builtin.group:
name: act_runner
system: true
- name: Create user
ansible.builtin.user:
name: act_runner
system: true
comment: Gitea act_runner
create_home: false
home: /var/empty
group: act_runner
groups:
- docker
shell: /sbin/nologin
- name: Install dependencies
ansible.builtin.package:
name: "{{ item }}"
state: installed
with_items:
- golang
- make
- name: Copy act runner packages
ansible.builtin.git:
dest: /usr/local/src/act_runner
repo: https://gitea.com/gitea/act_runner.git
version: "{{ gitea_runner_version }}"
notify: Build act_runner
- name: Link binary
ansible.builtin.file:
dest: /usr/local/sbin/act_runner
src: /usr/local/src/act_runner/act_runner
state: link
owner: root
group: "{{ ansible_wheel }}"
follow: false
- name: Create config directory
ansible.builtin.file:
path: /var/lib/act_runner
state: directory
mode: 0770
owner: root
group: act_runner