socketwench.gitlab-runner
Ansible Role: Gitlab Runner
This role installs Gitlab Runner and sets it up for you.
Requirements
None.
How to Use the Role
To install the latest version of Gitlab Runner without changing any settings, just add this role to your playbook:
roles:
- socketwench.gitlab-runner
Role Variables
Here are the available variables along with their default settings (check defaults/main.yml
for more details).
Global Runner Settings
gitlab_runner_concurrent_jobs
This sets how many jobs can run at the same time. Default is 1
.
gitlab_runner_log_level
This controls the log output of the runner system. Default is error
.
gitlab_runner_check_interval
This defines how often to look for new jobs. Default is 0
.
gitlab_runner_coordinator_url
This is the URL for the Gitlab CI coordinator. You can find it in Gitlab by going to a specific project, clicking on Settings, then CI/CD Pipelines.
Creating Runners
To create runners, set the gitlab_runners
variable like this:
gitlab_runners:
- name: "my_runner_name"
token: "1234567890qwertyuiopasdfghjkl"
If you don't specify an executor
, it will use shell
by default. For an example using SSH executor, see the playbook below.
Dependencies
None.
Example Playbook
---
- hosts: all
vars:
gitlab_runner_coordinator_url: "https://gitlab.example.com/ci"
gitlab_runners:
- name: "my_runner_name"
token: "1234567890qwertyuiopasdfghjkl"
executor: "ssh"
ssh_user: "setec_astonomy"
ssh_password: "toomanysecrets"
ssh_host: "sneakers.example.com"
roles:
- socketwench.gitlab-runner
License
GPL 3.0.
Author Information
This role was created in 2017 by socketwench.
ansible-galaxy install socketwench.gitlab-runner