Skip to content
Snippets Groups Projects
Commit 20673e85 authored by Harold Barker's avatar Harold Barker
Browse files

Register GitLab Runner

parent bff021ff
Branches
Tags
No related merge requests found
--- ---
# Maximum number of jobs to run concurrently # Maximum number of jobs to run concurrently
gitlab_runner_concurrent: '{{ ansible_processor_cores }}' gitlab_runner_concurrent: '{{ ansible_processor_cores }}'
# GitLab coordinator URL
gitlab_runner_coordinator_url: 'https://gitlab.com/ci'
# GitLab registration token
gitlab_runner_registration_token: ''
# Runner description
gitlab_runner_description: '{{ ansible_hostname }}'
# Runner executor
gitlab_runner_executor: 'shell'
# Runner tags
gitlab_runner_tags: []
...@@ -5,3 +5,7 @@ ...@@ -5,3 +5,7 @@
- name: Set global options - name: Set global options
include: global-setup.yml include: global-setup.yml
- name: Register GitLab Runner
include: register-runner.yml
when: gitlab_runner_registration_token != ''
---
- name: List configured runners
command: gitlab-runner list
register: configured_runners
- name: Register runner to GitLab
command: gitlab-runner register >
--non-interactive
--url '{{ gitlab_runner_coordinator_url }}'
--registration-token '{{ gitlab_runner_registration_token }}'
--description '{{ gitlab_runner_description }}'
--tag-list '{{ gitlab_runner_tags | join(",") }}'
--executor '{{ gitlab_runner_executor }}'
when: configured_runners.stderr.find('\n{{ gitlab_runner_description }}') == -1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment