lean_delivery.gitlab_runner
GitLab Runner Role
Summary
This Ansible role allows you to:
- Install GitLab Runner
Requirements
- Ansible version 2.8 or higher
- Supported Operating Systems:
- EL (RedHat, CentOS): 7, 8
- Amazon Linux 2
- Ubuntu: 16.04, 18.04
- Debian: 8, 9
Role Variables
Required Variables
gitlab_version
: Version of GitLab Runner to install (default islatest
).gitlab_api_token
: Token for accessing GitLab API (default is''
).gitlab_ci_token
: Token for registering the Runner (default is''
).gitlab_runner_description
: Unique name for the Runner (default includes hostname and distribution).
Default Variables
no_logs
: Hides sensitive information in logs (default istrue
).gitlab_runner_skip_registration
: Skips runner registration after installation (default isfalse
).gitlab_host
: Docker GitLab server (default isgitlab.com
).gitlab_url
: GitLab URL (default ishttps://{{ gitlab_host }}/
).gitlab_runner_tags
: Tags for the Runner, comma-separated (default isdelegated
).gitlab_runner_access_level
: Determines if the runner can pick jobs from protected branches (default isnot_protected
).gitlab_runner_untagged_builds_run
: Prevents picking untagged jobs (default isfalse
).gitlab_runner_lock_to_project
: Locks the Runner to the current project (default isfalse
).gitlab_runner_executor
: Executor type for the Runner (default isshell
).gitlab_runner_extra_options
: Additional options for registration (default isundefined
).gitlab_runner_limit
: Limits concurrent jobs (default is1
).gitlab_runner_concurrent
: Global limit for concurrent jobs using all defined runners (default is number of CPU cores).gitlab_runner_request_concurrency
: Limits concurrent job requests from GitLab (default is1
).gitlab_runner_env_vars
: Environment variables (default is["ENV=value", "LC_ALL=en_US.UTF-8"]
).gitlab_runner_package
: GitLab Runner package name (default isgitlab-runner
).gitlab_runner_packages_additional
: Additional packages to install (default is empty list).gitlab_runner_gpg
: GPG key for Debian (default ishttps://packages.gitlab.com/gpg.key
).gitlab_global_section
: Global configuration dictionary for GitLab (default settings provided).gitlab_session_server_section
: Session server configuration (default settings provided).gitlab_runners_section
: Runners configuration (default settings provided).
Advanced Configuration
gitlab_runner_config
: Dictionary for advanced settings (includes environment variables and custom values).
Additional Variables
yum_libselinux_python_library
: Name of SELinux Python library (default islibselinux-python
).yum_libselinux_config_libraries
: List of SELinux configuration libraries (default settings provided).epel_repository_url
: URL for EPEL repository package (default provided).epel_rpm_key
: EPEL RPM key (default provided).gitlab_runner_python_module_version
: Version of the python-gitlab library (default is'1.12.1'
).pip_executable
: Name of the pip executable (depends on OS).python_executable
: Name of the Python executable (depends on OS).
Installation Examples
You can install this role easily using playlabs with a simple command:
playlabs install lean_delivery.gitlab_runner @localhost gitlab_ci_token=yourcommand gitlab_host=yourlabs.io gitlab_runner_limit=4 gitlab_version=11.6
Or, without playlabs, use Galaxy:
ansible-galaxy install lean_delivery.gitlab_runner
Example Playbook
Installing GitLab Runner Without Registration
- name: Setup
hosts: gitlab_runner
roles:
- role: lean_delivery.gitlab_runner
vars:
gitlab_runner_concurrent: 1
gitlab_runner_skip_registration: true
Installing GitLab Runner With Registration and Configuration
- name: Setup
hosts: gitlab_runner
roles:
- role: lean_delivery.gitlab_runner
vars:
gitlab_runner_concurrent: 4
gitlab_runner_skip_registration: false
gitlab_api_token: >-
{{ lookup('env', 'GITLAB_API_TOKEN') }}
gitlab_ci_token: >-
{{ lookup('env', 'GITLAB_REGISTRATION_TOKEN') }}
gitlab_runner_description: 'My Great Runner'
gitlab_runner_tags:
- deploy_test
- shell
gitlab_runner_untagged_builds_run: false
gitlab_version: '12.5.1'
License
Apache License
Author Information
Authors:
- Lean Delivery Team team@lean-delivery.com
Informazioni sul progetto
Lean Delivery Gitlab Runner install
Installa
ansible-galaxy install lean_delivery.gitlab_runner
Licenza
apache-2.0
Download
43.2k
Proprietario
Simplify by using!