Skip to content

Commit 9221c4c

Browse files
author
Jens Hörnlein
committed
link amount of created runners and runner config
1 parent 4fea561 commit 9221c4c

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

gitlab-runner.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,8 @@
4343
# and this for non-interactive mode:
4444
# https://gitlab.com/gitlab-org/gitlab-runner/blob/master/docs/commands/README.md#non-interactive-registration
4545
- name: Register Gitlab-Runners using shell executor
46-
shell: "gitlab-runner register --non-interactive --url '{{gitlab_url}}' --registration-token '{{gitlab_runner_registration_token}}' --description '{{ item.name }}' --executor shell"
47-
with_items:
48-
- { name: shell-runner-1 }
49-
- { name: shell-runner-2 }
50-
- { name: shell-runner-3 }
51-
- { name: shell-runner-4 }
52-
- { name: shell-runner-5 }
46+
shell: "gitlab-runner register --non-interactive --url '{{gitlab_url}}' --registration-token '{{gitlab_runner_registration_token}}' --description 'shell-runner-{{ item }}' --executor shell"
47+
loop: "{{ range(1,gitlab_runner_count + 1)|list }}"
5348

5449
# number of concurrent runners needs to be set directly in config-file in order to actually run jobs in parallel
5550
# see: https://gitlab.com/gitlab-org/gitlab-runner/issues/1539
@@ -58,7 +53,7 @@
5853
path: /etc/gitlab-runner/config.toml
5954
section:
6055
option: concurrent
61-
value: 5
56+
value: "{{ gitlab_runner_count }}"
6257

6358
- name: Retrieve all registered Gitlab Runners
6459
shell: "gitlab-runner list"

prepare-gitlab.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
gitlab_domain: "gitlab.jonashackt.io"
77
gitlab_url: "https://{{ gitlab_domain }}"
88
gitlab_registry_url: "{{ gitlab_url }}:4567"
9+
gitlab_runner_count: 5
910

1011
tasks:
1112

0 commit comments

Comments
 (0)