split KVM and docker configs

Config cannot have conflicting executor configurations. One _must_
specify the selected executor in a sub-section. eg. "[runners.docker]",
otherwise you end up with mysterious errors like:

 WARNING: Job failed: panic: runtime error: invalid memory address or
 nil pointer dereference
master
Devan Carpenter 2 years ago
parent 44ce3fe7db
commit 14bcd20a41
Signed by: dvn
GPG Key ID: E1707CFFD7B85A02

@ -55,10 +55,17 @@
with_items: [config, prepare, run, cleanup]
when: ansible_local.gitlab_runner.executor == "kvm"
- name: Install configuration for the gitlab runner
- name: Install KVM configuration for the gitlab runner
template:
src: gitlab-runner.toml
src: gitlab-runner-kvm.toml
dest: /etc/gitlab-runner/config.toml
when: ansible_local.gitlab_runner.executor == "kvm"
- name: Install Docker configuration for the gitlab runner
template:
src: gitlab-runner-docker.toml
dest: /etc/gitlab-runner/config.toml
when: ansible_local.gitlab_runner.executor == "docker"
- name: Put gitlab-runner in the docker group
user:

@ -0,0 +1,18 @@
concurrent = 5
check_interval = 0
log_level = "info"
[session_server]
session_timeout = 1800
[[runners]]
name = "{{ ansible_fqdn }}"
url = "https://{{ ansible_local.gitlab_runner.gitlab_domain }}"
token = "{{ ansible_local.gitlab_runner.runner_token }}"
executor = "{{ ansible_local.gitlab_runner.executor }}"
[runners.docker]
image = "debian:stable"
privileged = false
disable_cache = false
shm_size = 0

@ -1,5 +1,6 @@
concurrent = 5
check_interval = 0
log_level = "info"
[session_server]
session_timeout = 1800
Loading…
Cancel
Save