Add a GitLab runner

Woo CI!
This commit is contained in:
Jake Howard 2021-06-01 19:29:21 +01:00
parent 64ebaa67d0
commit a867df04a5
Signed by: jake
GPG key ID: 57AFB45680EDD477
7 changed files with 57 additions and 0 deletions

View file

@ -17,3 +17,5 @@ pve_hosts:
ip: 10.23.1.21 ip: 10.23.1.21
gitlab: gitlab:
ip: 10.23.1.43 ip: 10.23.1.43
gitlab_runner:
ip: 10.23.1.48

View file

@ -11,3 +11,4 @@ forrest
qbittorrent qbittorrent
restic restic
pve-gitlab pve-gitlab
pve-gitlab-runner

View file

@ -28,6 +28,7 @@
- pve-docker - pve-docker
- forrest - forrest
- walker - walker
- pve-gitlab-runner
roles: roles:
- role: geerlingguy.docker - role: geerlingguy.docker
become: true become: true
@ -99,3 +100,7 @@
- hosts: pve-gitlab - hosts: pve-gitlab
roles: roles:
- gitlab - gitlab
- hosts: pve-gitlab-runner
roles:
- gitlab_runner

View file

@ -0,0 +1,19 @@
concurrent = {{ ansible_processor_nproc }}
log_level = "warning"
check_interval = 10
[session_server]
session_timeout = 1800
[[runners]]
name = "runner"
url = "https://code.theorangeone.net"
token = "{{ gitlab_runner_token }}"
limit = 0
executor = "docker"
[runners.docker]
image = "alpine"
privileged = false
disable_cache = false
volumes = ["/cache"]

View file

@ -0,0 +1,5 @@
- name: restart gitlab-runner
service:
name: gitlab-runner
state: restarted
become: true

View file

@ -0,0 +1,18 @@
- name: Install runner
package:
name: gitlab-runner
become: true
- name: Install config
template:
src: files/config.toml
dest: /etc/gitlab-runner/config.toml
mode: "0600"
become: true
notify: restart gitlab-runner
- name: Enable runner
service:
name: gitlab-runner
enabled: true
become: true

View file

@ -0,0 +1,7 @@
gitlab_runner_token: !vault |
$ANSIBLE_VAULT;1.1;AES256
65643664363337623138623538363032646330316263626632353233373832313235353939643465
3736633363663137653432306465626331653064303736310a313030646266316230396563313834
39366638646238303936633961343030623030633034653133376663656263333034373265313764
6637373531373262610a323037316336346339616563373933313436633337656634393535333235
36653337383864666137323331636136653338313133316265366337646465313533