Add a GitLab runner
Woo CI!
This commit is contained in:
parent
64ebaa67d0
commit
a867df04a5
7 changed files with 57 additions and 0 deletions
|
@ -17,3 +17,5 @@ pve_hosts:
|
|||
ip: 10.23.1.21
|
||||
gitlab:
|
||||
ip: 10.23.1.43
|
||||
gitlab_runner:
|
||||
ip: 10.23.1.48
|
||||
|
|
|
@ -11,3 +11,4 @@ forrest
|
|||
qbittorrent
|
||||
restic
|
||||
pve-gitlab
|
||||
pve-gitlab-runner
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
- pve-docker
|
||||
- forrest
|
||||
- walker
|
||||
- pve-gitlab-runner
|
||||
roles:
|
||||
- role: geerlingguy.docker
|
||||
become: true
|
||||
|
@ -99,3 +100,7 @@
|
|||
- hosts: pve-gitlab
|
||||
roles:
|
||||
- gitlab
|
||||
|
||||
- hosts: pve-gitlab-runner
|
||||
roles:
|
||||
- gitlab_runner
|
||||
|
|
19
ansible/roles/gitlab_runner/files/config.toml
Normal file
19
ansible/roles/gitlab_runner/files/config.toml
Normal 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"]
|
5
ansible/roles/gitlab_runner/handlers/main.yml
Normal file
5
ansible/roles/gitlab_runner/handlers/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- name: restart gitlab-runner
|
||||
service:
|
||||
name: gitlab-runner
|
||||
state: restarted
|
||||
become: true
|
18
ansible/roles/gitlab_runner/tasks/main.yml
Normal file
18
ansible/roles/gitlab_runner/tasks/main.yml
Normal 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
|
7
ansible/roles/gitlab_runner/vars/main.yml
Normal file
7
ansible/roles/gitlab_runner/vars/main.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
gitlab_runner_token: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
65643664363337623138623538363032646330316263626632353233373832313235353939643465
|
||||
3736633363663137653432306465626331653064303736310a313030646266316230396563313834
|
||||
39366638646238303936633961343030623030633034653133376663656263333034373265313764
|
||||
6637373531373262610a323037316336346339616563373933313436633337656634393535333235
|
||||
36653337383864666137323331636136653338313133316265366337646465313533
|
Loading…
Reference in a new issue