{"id":19442656,"url":"https://github.com/lean-delivery/ansible-role-gitlab-runner","last_synced_at":"2025-04-25T00:31:59.781Z","repository":{"id":96540713,"uuid":"145731341","full_name":"lean-delivery/ansible-role-gitlab-runner","owner":"lean-delivery","description":"Ansible Role - GitLab Runner","archived":false,"fork":false,"pushed_at":"2022-11-26T19:41:31.000Z","size":64,"stargazers_count":19,"open_issues_count":0,"forks_count":11,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-03T13:21:26.568Z","etag":null,"topics":["ansible","gitlab-runner","gitlab-runner-role"],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/lean_delivery/gitlab_runner","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lean-delivery.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-22T15:54:58.000Z","updated_at":"2023-03-02T07:11:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"75dd71f0-ef51-43ea-9859-abda74f55462","html_url":"https://github.com/lean-delivery/ansible-role-gitlab-runner","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lean-delivery%2Fansible-role-gitlab-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lean-delivery%2Fansible-role-gitlab-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lean-delivery%2Fansible-role-gitlab-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lean-delivery%2Fansible-role-gitlab-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lean-delivery","download_url":"https://codeload.github.com/lean-delivery/ansible-role-gitlab-runner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250733243,"owners_count":21478320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","gitlab-runner","gitlab-runner-role"],"created_at":"2024-11-10T15:40:27.188Z","updated_at":"2025-04-25T00:31:59.771Z","avatar_url":"https://github.com/lean-delivery.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"gitlab-runner role\n=========\n\n[![License](https://img.shields.io/badge/license-Apache-green.svg?style=flat)](https://raw.githubusercontent.com/lean-delivery/ansible-role-gitlab-runner/master/LICENSE)\n[![Build Status](https://travis-ci.org/lean-delivery/ansible-role-gitlab-runner.svg?branch=master)](https://travis-ci.org/lean-delivery/ansible-role-gitlab-runner)\n[![Build Status](https://gitlab.com/lean-delivery/ansible-role-gitlab-runner/badges/master/pipeline.svg)](https://gitlab.com/lean-delivery/ansible-role-gitlab-runner/pipelines)\n[![Galaxy](https://img.shields.io/badge/galaxy-lean__delivery.gitlab__runner-blue.svg)](https://galaxy.ansible.com/lean_delivery/gitlab_runner)\n![Ansible](https://img.shields.io/ansible/role/d/29089.svg)\n![Ansible](https://img.shields.io/badge/dynamic/json.svg?label=min_ansible_version\u0026url=https%3A%2F%2Fgalaxy.ansible.com%2Fapi%2Fv1%2Froles%2F29089%2F\u0026query=$.min_ansible_version)\n\n## Summary\n\nThis Ansible role has the following features:\n\n - Install gitlab-runner\n\nRequirements\n------------\n\n - Version of the ansible for installation: 2.8\n - **Supported OS**:\n   - EL (RedHat, CentOS)\n     - 7, 8\n   - Amazon2 Linux\n   - Ubuntu\n     - 16.04\n     - 18.04\n   - Debian\n     - 8, 9\n\n## Role Variables\n\n- required\n  - `gitlab_version`  \n  Specific version of Gitlab-Runner. Default value is `latest`.\n  - `gitlab_api_token`  \n  A token you need to access Gitlab API. Default value is `''`.\n  - `gitlab_ci_token`  \n  A Token you obtained to register the Runner. Default value is `''`.\n  - `gitlab_runner_description`  \n  The unique name of the runner. Default value:   \n```\n    {{ ansible_fqdn }}\n    {{ ansible_distribution }}\n    {{ ansible_distribution_major_version }}\n```\n\n- defaults\n  - `no_logs`  \n  Hide sensitive information from logs. Default value is `true`\n  - `gitlab_runner_skip_registration`  \n  Skip gitlab-runner registration after installation. Default value is `false`\n  - `gitlab_host`   \n  Docker gitlab server. Default value is `gitlab.com`\n  - `gitlab_url`   \n  Gitlab url address. Default value: `https://{{ gitlab_host }}/`\n  - `gitlab_runner_tags`  \n  The tags associated with the Runner. Should be comma delimited. Default value is `delegated`\n  - `gitlab_runner_access_level: not_protected`  \n  Determines if a runner can pick up jobs from protected branches. Available values: `ref_protected` `not_protected` Default value is `not_protected`\n  - `gitlab_runner_untagged_builds_run`  \n  Config that prevents it from picking untagged jobs. Default value is `false`\n  - `gitlab_runner_lock_to_project`  \n  Config that lock the Runner to current project. Default value is `false`\n  - `gitlab_runner_executor`  \n  Runner executor. Default value is `shell`\n  - `gitlab_runner_extra_options`  \n  Extra option for runner registration process. Default value is `undefined`\n  - `gitlab_runner_limit`  \n  Config that Limit how many jobs can be handled concurrently by this token. `0` simply means don't limit. Default value is `1`\n  - `gitlab_runner_concurrent`  \n  Limits how many jobs globally can be run concurrently.\n  The most upper limit of jobs using all defined runners.\n  0 does not mean unlimited. Default value is `ansible_processor_vcpus`\n  - `gitlab_runner_request_concurrency`  \n  Limit number of concurrent requests for new jobs from GitLab. Default value is `1`\n  - `gitlab_runner_env_vars`  \n  Append or overwrite environment variables. Default value is `[\"ENV=value\", \"LC_ALL=en_US.UTF-8\"]`\n  - `gitlab_runner_package`\n  Gitlab-runner package name. Default: `gitlab-runner`\n  - `gitlab_runner_packages_additional`  \n  Install additional packages for all installs. Default value is `[]`\n  - `gitlab_runner_gpg`  \n  GPG key for Debian. Default value is `https://packages.gitlab.com/gpg.key`\n  - `gitlab_global_section`   \n  Global section of gitclab config. Default is dictionary:\n  ```yaml\n    concurrent: '{{ gitlab_runner_request_concurrency }}'\n    check_interval: 0\n  ```\n\n  - `gitlab_session_server_section`   \n  Server section of gitlab config. Default is dictionary:\n    `session_timeout: 1800`\n  - `gitlab_runners_section`   \n  Runners section of gitlab config. Default is dictionary:\n  ```yaml\n    name: '{{ gitlab_runner_description }}'\n    url: '{{ gitlab_url }}'\n    token: '{{ gitlab_runner.runner.token | default(omit) }}'\n    executor: '{{ gitlab_runner_executor }}'\n    environment: '{{ gitlab_runner_env_vars }}'\n  ```\n\n- advanced configuration\n  - `gitlab_runner_config`  \n  Dictionary used for advanced configs:\n    - `params`  \n    Environment variables used during the registration process\n    - `global_values`  \n    Dictionary with *key:value* used to add/change ***non string values*** in the file \"config.toml\"\n    - `global_strings`  \n    Dictionary with *key:value* used to add/change ***string values*** in the file \"config.toml\"\n\n- additional variables\n  - `yum_libselinux_python_library`  \n  Selinux python library name. Default value: `libselinux-python`\n  For RedHat 8 or Fedora library name may be different, e.g. `python3-libselinux`.  \n  - `yum_libselinux_config_libraries`  \n  Selinux config libraries. Default value is list: `[policycoreutils-python, libsemanage-python]`. \n  For RedHat 8 or Fedora value may be different:\n    - python3-policycoreutils\n    - python3-libsemanage\n  - `epel_repository_url`  \n  URL of EPEL repo package. Default: `https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm`  \n  - `epel_rpm_key`  \n  EPEL rpm key. Default value: `/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}`  \n  - `gitlab_runner_python_module_version`  \n  Version of python-gitlab library. Default: `'1.12.1'`\n  - `pip_executable`  \n  Name of pip executable binary. Default:\n    - `pip` for RedHat based targets\n    - `pip3` for Debian based targets\n  - `python_executable`   \n  Name of python executable. Default:\n    - `python` for RedHat based targets\n    - `python3` for Debian based targets\n\n## Some examples of the installing current role\n\nWith [playlabs](https://yourlabs.io/oss/playlabs) you can install this role with just one command, ie:\n\n    playlabs install lean_delivery.gitlab_runner @localhost gitlab_ci_token=yourcommand gitlab_host=yourlabs.io gitlab_runner_limit=4 gitlab_version=11.6\n\nOr, without playlabs, install with galaxy so that you can use with your playbook:\n\nansible-galaxy install lean_delivery.gitlab_runner\n\nExample Playbook\n----------------\n\n### Installing gitlab-runner without registration:\n```yaml\n- name: Converge\n  hosts: gitlab_runner\n  roles:\n    - role: lean_delivery.gitlab_runner\n  vars:\n    gitlab_runner_concurrent: 1\n    gitlab_runner_skip_registration: true\n```\n\n### Installing gitlab-runner with registration and config:\n```yaml\n- name: Converge\n  hosts: gitlab_runner\n  roles:\n    - role: lean_delivery.gitlab_runner\n      gitlab_runner_concurrent: 4\n      gitlab_runner_skip_registration: false\n      gitlab_api_token: \u003e-\n        {{ lookup('env', 'GITLAB_API_TOKEN') }}\n      gitlab_ci_token: \u003e-\n        {{ lookup('env', 'GITLAB_REGISTRATION_TOKEN') }}\n      gitlab_runner_description: 'My Great Runner'\n      gitlab_runner_tags:\n        - deploy_test\n        - shell\n      gitlab_runner_untagged_builds_run: false\n      gitlab_runner_concurrent: 1\n      gitlab_version: '12.5.1'\n      gitlab_runner_skip_registration: false\n```\n\nLicense\n-------\n\nApache\n\n[![License](https://img.shields.io/badge/license-Apache-green.svg?style=flat)](https://raw.githubusercontent.com/lean-delivery/ansible-role-gitlab-runner/master/LICENSE)\n\nAuthor Information\n------------------\n\nauthors:\n  - Lean Delivery Team \u003cteam@lean-delivery.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flean-delivery%2Fansible-role-gitlab-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flean-delivery%2Fansible-role-gitlab-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flean-delivery%2Fansible-role-gitlab-runner/lists"}