ansible-role-gitlab_runner/README.md
2025-01-10 20:08:42 +02:00

104 lines
3.4 KiB
Markdown

Gitlab Runner
=========
Gitlab Runner installation and registration on Ubuntu 24.04.
Requirements
------------
Docker engine must be insalled on the host for runner to function properly.
Role Variables
--------------
Maximum number of concurrent pipelines (default: 1):
`gitlab_runner_concurrent: 1`
Name displayed in Gitlab (default: Docker Runner):
`gitlab_runner_name: Docker Runner`
Url of Gitlab instance to add runner to (default: https://gitlab.com/):
`gitlab_runner_api_url: https://gitlab.domain.tld/`
Project (default: undefined):
`gitlab_runner_api_project: my_username/project_name`
Project api token (default: undefined):
```
gitlab_runner_api_token: !vault |
$ANSIBLE_VAULT;1.1;AES256
36616663623162396637356631613539346362653630623062313262653532396161616663366166
3332663961396266373937653733626565656662346631630a623065313663303264376562346232
64316666336365313861633965666536663636633065326236653135363561393566336564373339
6438653437333766350a626431356431306536363132303263663537383636353966383934636538
62373337383964656338653262633538623235353431613462383664656565323139
```
Runner registration token (default: undefined):
```
gitlab_runner_registration_token: !vault |
$ANSIBLE_VAULT;1.1;AES256
66643138616232313362376635626538363031316430313433363533396237323961353831396534
3962333233643630326564626162343636626237643430640a653533383431356134376662643666
37666430393935333761386534326539393966616431383263396139613639623438653464313233
6333383661636565390a663363613533363363616232616463633530663639316238356462303631
38626430613033356466393637623964363638616364376561636465633734666265
```
Dependencies
------------
No dependencies.
Example Playbook
----------------
```
---
- hosts: gitlab_ci
vars:
gitlab_runner_concurrent: 1
gitlab_runner_name: Docker Runner
gitlab_runner_api_url: https://gitlab.domain.tld/
gitlab_runner_api_project: my_username/my_name
gitlab_runner_api_token: !vault |
$ANSIBLE_VAULT;1.1;AES256
36616663623162396637356631613539346362653630623062313262653532396161616663366166
3332663961396266373937653733626565656662346631630a623065313663303264376562346232
64316666336365313861633965666536663636633065326236653135363561393566336564373339
6438653437333766350a626431356431306536363132303263663537383636353966383934636538
62373337383964656338653262633538623235353431613462383664656565323139
gitlab_runner_registration_token: !vault |
$ANSIBLE_VAULT;1.1;AES256
66643138616232313362376635626538363031316430313433363533396237323961353831396534
3962333233643630326564626162343636626237643430640a653533383431356134376662643666
37666430393935333761386534326539393966616431383263396139613639623438653464313233
6333383661636565390a663363613533363363616232616463633530663639316238356462303631
38626430613033356466393637623964363638616364376561636465633734666265
pre_tasks:
- name: Update apt cache.
ansible.builtin.apt:
update_cache: true
cache_valid_time: 86400
roles:
- role: cuqmbr.docker
- role: cuqmbr.gitlab_runner
```
TODO
----------------
Add support for other Linux distrubitions:
- RHEL: Almalinux, RockyLinux 9 and 8
- Debian: Debian 12 and 11, Ubuntu 24.04 and 22.04
- Archlinux
Make role more generic:
- Add more runner installation configuration options (executors, settings ...)
- Add support for registering without registration token