Deploy gitea's runner
Unofficial container, because there isn't an official one
This commit is contained in:
parent
23c2f7bcec
commit
a6a6fd9e76
8 changed files with 58 additions and 0 deletions
|
@ -24,3 +24,5 @@ pve_hosts:
|
|||
ip: 10.23.1.105
|
||||
renovate:
|
||||
ip: 10.23.1.110
|
||||
gitea_runner:
|
||||
ip: 20.23.1.114
|
||||
|
|
|
@ -15,3 +15,4 @@ restic
|
|||
pve-gitlab
|
||||
pve-gitlab-runner
|
||||
renovate
|
||||
gitea-runner
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
- pve-gitlab-runner
|
||||
- grimes
|
||||
- renovate
|
||||
- gitea-runner
|
||||
roles:
|
||||
- role: geerlingguy.docker
|
||||
become: true
|
||||
|
@ -124,6 +125,10 @@
|
|||
roles:
|
||||
- gitlab_runner
|
||||
|
||||
- hosts: gitea-runner
|
||||
roles:
|
||||
- gitea_runner
|
||||
|
||||
- hosts: grimes
|
||||
roles:
|
||||
- nebula
|
||||
|
|
15
ansible/roles/gitea_runner/files/docker-compose.yml
Normal file
15
ansible/roles/gitea_runner/files/docker-compose.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
version: "2.3"
|
||||
|
||||
services:
|
||||
act-runner:
|
||||
image: vegardit/gitea-act-runner:latest
|
||||
network_mode: host
|
||||
volumes:
|
||||
- ./data:/data
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
environment:
|
||||
- TZ={{ timezone }}
|
||||
- GITEA_INSTANCE_URL=https://gitea.theorangeone.net
|
||||
- GITEA_RUNNER_REGISTRATION_TOKEN={{ gitea_runner_registration_token }}
|
||||
- GITEA_RUNNER_NAME={{ ansible_hostname }}
|
||||
restart: unless-stopped
|
4
ansible/roles/gitea_runner/handlers/main.yml
Normal file
4
ansible/roles/gitea_runner/handlers/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
- name: restart act-runner
|
||||
shell:
|
||||
chdir: /opt/act-runner
|
||||
cmd: "{{ docker_update_command }}"
|
20
ansible/roles/gitea_runner/tasks/main.yml
Normal file
20
ansible/roles/gitea_runner/tasks/main.yml
Normal file
|
@ -0,0 +1,20 @@
|
|||
- name: Include vault
|
||||
include_vars: vault.yml
|
||||
|
||||
- name: Create install directory
|
||||
file:
|
||||
path: /opt/act-runner
|
||||
state: directory
|
||||
owner: "{{ docker_user.name }}"
|
||||
mode: "{{ docker_compose_directory_mask }}"
|
||||
become: true
|
||||
|
||||
- name: Install compose file
|
||||
template:
|
||||
src: files/docker-compose.yml
|
||||
dest: /opt/act-runner/docker-compose.yml
|
||||
mode: "{{ docker_compose_file_mask }}"
|
||||
owner: "{{ docker_user.name }}"
|
||||
validate: docker-compose -f %s config
|
||||
notify: restart act-runner
|
||||
become: true
|
1
ansible/roles/gitea_runner/vars/main.yml
Normal file
1
ansible/roles/gitea_runner/vars/main.yml
Normal file
|
@ -0,0 +1 @@
|
|||
gitea_runner_registration_token: "{{ vault_gitea_runner_registration_token }}"
|
10
ansible/roles/gitea_runner/vars/vault.yml
generated
Normal file
10
ansible/roles/gitea_runner/vars/vault.yml
generated
Normal file
|
@ -0,0 +1,10 @@
|
|||
$ANSIBLE_VAULT;1.1;AES256
|
||||
39356636363738343339633132326666373534646563366335363336356362343438313030353466
|
||||
6564373739333030393666333438386533316332626136350a626439316537343030323761383863
|
||||
33666632636132386335393833636232373662626562326531666330373438613738613634643061
|
||||
3864336432626338320a373866356363613166366239356630663534646566636131353530623266
|
||||
66326334636361386338663739333134333761376239373133396534376139633364336433663362
|
||||
30313736303539663839313830336164346536383066393635323366363433616264373165356431
|
||||
35663832323132356538666333653135383332653232336336646265356665313165623035363561
|
||||
65306666393331383661353961306531636266393765626363616265326566316163396531373638
|
||||
3735
|
Loading…
Reference in a new issue