jygastaud.gitlab-runner
GitLab Runner
This guide is for installing the official GitLab Runner (a version from haroldb). I created this because I needed something simple that works. Feel free to suggest changes!
Requirements
You need Ansible version 2.0 or higher to use this role.
Role Variables
gitlab_runner_package_name
: From GitLab version 10.x, the package namegitlab-ci-multi-runner
has changed togitlab-runner
. To install version 10.x or higher, set this variable:gitlab_runner_package_name: gitlab-runner
.gitlab_runner_concurrent
: This is the maximum number of jobs the runner can handle at the same time. It defaults to the number of processor cores available.gitlab_runner_registration_token
: This is the token needed to register a runner with a GitLab server. You need to specify this if you want to register the runner.gitlab_runner_coordinator_url
: This is the URL for the GitLab coordinator. It defaults tohttps://gitlab.com/ci
.gitlab_runner_description
: A description for the runner, which defaults to the hostname of the machine.gitlab_runner_executor
: This specifies the executor to be used by the runner, defaulting toshell
.gitlab_runner_docker_image
: This is the default Docker image used when the executor is set todocker
.gitlab_runner_tags
: Tags can be assigned to the runner. This defaults to an empty list.
For more options, refer to the configuration file.
Example Playbook
- hosts: all
remote_user: root
vars_files:
- vars/main.yml
roles:
- { role: riemers.gitlab-runner }
In vars/main.yml
gitlab_runner_registration_token: 'HUzTMgnxk17YV8Rj8ucQ'
gitlab_runner_description: 'Example GitLab Runner'
gitlab_runner_tags:
- node
- ruby
- mysql
gitlab_runner_docker_volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "/cache"
ansible-galaxy install jygastaud.gitlab-runner