Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


gitlab-ci-runner (23) Versions 2.1.0

Installs/Configures Gitlab CI Runner

cookbook 'gitlab-ci-runner', '= 2.1.0', :supermarket
cookbook 'gitlab-ci-runner', '= 2.1.0'
knife supermarket install gitlab-ci-runner
knife supermarket download gitlab-ci-runner
Quality 50%

Gitlab CI Runner


Install and configure runners for gitlab-ci. Use
gitlab-ci-multi-runner as runner type. Learn more on


Cookbooks and gems

Declared in [metadata.rb](metadata.rb) and in [Gemfile](Gemfile).


  • RHEL Family 7, tested on CentOS
  • Debian 8


Easy Setup

Add recipe[gitlab-ci-runner] in your run-list to install
gitlab-ci-multi-runner using its repository.

To add runners, use default provider or use
recipe[gitlab-ci-runner::register] and runners attribute. To see a use
case, look at [kitchen.yml](kitchen.yml).


This cookbook is fully tested through the installation of the full gitlab
platform in docker hosts. This uses kitchen, docker and some monkey-patching.

If you run kitchen list, you will see 3 suites, Each corresponds to a different

  • kitchen-gitlab-ubuntu-1404: complete instance of gitlab-ce
  • kitchen-gitlab-ci-runner-centos-7: installation of gitlab-ci-multi-runner and configuration of runners on a centos-7
  • kitchen-gitlab-ci-runner-debian-8: same but for debian-8

For more information, see [kitchen.yml](kitchen.yml) and [test](test)



Install gitlab-ci-multi-runner by using its repository, enable and start
the service.


Install runner repository.


Install gitlab-ci-multi-runner package.


Enable and start runner service.


Register or Unregister runners based on attribute
['gitlab-ci-runner']['runners']. This is an Array of Hash where each Hash
represent an action on a runner, "register" or "unregister". In a Hash,
description key is the name attribute and represents the name of the runner.
Then each runner option should be listed in a sub-Hash of key options, each
sub-key matching an option name of gitlab-runner cli.

NOTICE: Due to the way that the cache configuration file parameter names
do not match their command line variants in a reliably convertible way they
will not be set during initial registration. They will be added to the
configuration file during the next chef run. You are advised to use the
register_string property to manually set the registration string if this
will be an issue.

See [kitchen.yml](kitchen.yml) for an example.



Manage the global options of Gitlab CI runner, all settings are optional.

gitlab_ci_runner_global_config '/etc/gitlab-runner/config.toml' do
  concurrent 5
  log_level info
  log_format text
  check_interval 0
  sentry_dsn false
  listen_address ''
    "listen_address" => "",
    "advertise_address" => "runner-host-name.tld:8093",
    "session_timeout"=> 1800

The full resource options list is available in


Manage the installation of Gitlab CI runner, all settings are optional.

gitlab_ci_runner_package 'gitlab-runner' do
  repo_url 'http://specify.custom.repo'
  gpgkey 'http://specify.custom.repo/gpgkey'
  gpgcheck false
  version '12.7.1'
  tls_verify false
  timeout 5
    'retries': 3,
    'retry_delay': 5
  action :install

The full resource options list is available in


Manage the Gitlab CI runner service, all settings are optional.

gitlab_ci_runner_service 'gitlab-runner' do
  action [:enable, :start]

The full resource options list is available in



  • :register - Register a runner updating its settings if already registered.
  • :update - Update settings for a previously registered runner.
  • :unregister - Unregister a runner and remove its configuration.

General properties

Property Optional? Type Description
url Register: No String Gitlab server URL.
Unregister: Yes
registration_token Register: No String Gitlab server runner registration token.
Unregister: Yes
administration_token Yes String Token with API access for an administrator on the gitlab server.
config Yes String Gitlab runner configuration file path.

Server option properties

Property Optional? Type Description
description Yes String Server runner description.
active Yes Bool The state of a runner; can be set to true or false, paused runners don't accept new jobs.
tag_list Yes Array The list of tags for a runner; put array of tags, that should be finally assigned to a runner.
run_untagged Yes Bool Flag indicating the runner can execute untagged jobs.
locked Yes Bool Flag indicating the runner is locked When a runner is locked, it cannot be assigned to other projects.
access_level Yes String The access_level of the runner; not_protected or ref_protected
maximum_timeout Yes Int Maximum timeout set when this Runner will handle the job.

Local option properties

Property Optional? Type Description
options Yes Hash Runner configuration options.

Register or Unregister runners. For instance, to register a default runner
to http://gitlab-ci.myinstance:

gitlab_ci_runner_runner 'my runner' do
  registration_token '1234567890'
  administrative_token '987654321'
  url 'http://gitlab-ci.myinstance'
  tag_list [ "testing-1", "testing-2" ]
    'executor': 'shell'

Runners that are already registered will have their configuration updated to
match the supplied options. Empty hash values will be compacted (removed).

If an administrative token with suitable permissions has been provided the
server runner configuration will also be updated to match the resource.

Example options:

  "name" => "Testing Docker Runner 1",
  "url" => "",
  "registration_token" => "1234567890",
  "options" => {
    "executor" => "docker",
    "docker" => {
      "image" => "centos",
      "privileged" => false,
      "disable_entrypoint_overwrite" => false,
      "oom_kill_disable" => false,
      "disable_cache" => false,
      "volumes" => [
      "shm_size" => 0
    "cache" => {
      "s3" => {},
      "gcs" => {}
    "custom_build_dir" => {
      "enabled" => true
  "tag_list" => [

Will generate this configuration:

executor = "docker"
name = "Testing Docker Runner"
token = "9dK52sYkuXeVudzw3HuH"
url = ""

disable_cache = false
disable_entrypoint_overwrite = false
image = "centos"
oom_kill_disable = false
privileged = false
shm_size = 0
volumes = ["/cache","/etc/chef:/etc/chef:ro"]

enabled = true

The full resource options list is available in



  • :set - Get runner global configuration options


Property Optional? Type
config Yes String
concurrent Yes Int
log_level Yes String
log_format Yes String
check_interval Yes Int
sentry_dsn Yes Bool
listen_address Yes String
options Yes Hash

Manage the global options of Gitlab CI runner, all settings are optional.

gitlab_ci_runner_global_config '/etc/gitlab-runner/config.toml' do
  concurrent 5
  log_level info
  log_format text
  check_interval 0
  sentry_dsn false
    "listen_address" => "",
    "advertise_address" => "runner-host-name.tld:8093",
    "session_timeout"=> 1800

The full resource options list is available in


Available in [](


Please read carefully []( before making a merge

License and Author

Copyright (c) 2015-2017 Sam4Mobile, 2017-2018, 2019 Samuel Bernard

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.



  • feat: add api http properties to runner resource
    • Allows override of all net/http attributes
  • feat: add template setting properties to runner and global_config resources
    • Allows override of template file, owner, group, mode and sensitivity.
  • feat: minimum supported Chef version is now 14
  • fix: package resource repo overrides



  • feat: remodel cookbook as a library
    • Attributes have been removed
    • Recipes have been removed
    • Recipe functionality is now provided by resources
    • The gitlab_ci_runner resource is now gitlab_ci_runner_runner



  • fix: switch array Array.difference to Array.- for Chef < 15
    • Array.difference was added in Ruby 2.6 which requires Chef 15 or later
  • fix: raise minimum Chef version to 13
  • test: kitchen test with Chef 13



  • feat: add support for session_server options
  • feat: rewrite to use api to manage runners
    • Configuration file is now generated by acculumated template so manual modifications will be overwritten.
    • Registration options have been moved from the options has to resource properties. The resource will attempt to get registrations from options if they have not been specified.
    • :update action added to update a runner without registration.


  • doc: add example showing custom_build_dir runner



  • feat: add support for Fedora 28
  • feat: port resource/provider to custom resource #8
    • Resource is tested as idempotent
  • feat: add global configuration resource #7
    • Create a global configuration resource as it doesn't make sense to add it to the runner resource as multiple runners could overwrite each other and it is impossible to automatically figure out the precedence
  • feat: manual registration string property
    • Due to the differences between the naming of TOML and CLI fields for certain options, provide an ability to manually specify a registration string. Also, prevent these options from causing registration to fail if they are specified in an options hash.


  • include .gitlab-ci.yml from test-cookbook
  • replace deprecated require_chef_omnibus
  • runner config mgmt and library spec test
    • Already registered runners will now have their configuration managed by the gitlab-ci-runner resource. Any changes after registration will be propogated to the config.toml file by the resource
    • Create spec tests for library methods
  • chore: add chef license accept to kitchen config
  • extend spec testing for refactor
  • rename kitchen config file (kitchen.yml instead of .kitchen.yml)
  • switch to chefplatform images


  • style(rubocop): fix newer offenses
  • feat: remove deprecated use_inline_resources
  • doc: use doc in git message instead of docs
  • chore: set generic maintainer & helpdesk email
  • chore: add supermarket category in .category
  • chore: move toml gem install to package recipe
    • Move the toml gem install resource to the package recipe so it is available even if no runners are initially defined as the global_config resource depends on it
  • chore: update copyright for 2019

Special thanks to Benjamin M. Hughes ( for
his major contribution to this version.



  • update repository url and package name to match version > 10
    • set minimal version support to 10+
  • feat: add amazon platform to yum repo configuration


  • style: replace updated_by_last_action by converge_by
  • style(rubocop): fix offenses (heredoc and rescue)
  • chore: add foodcritic & rubocop in Gemfile



  • add Debian support
  • fix #2: gitlab-runner pkg version is configurable
  • fix(debian): set package retries only when non nil
  • fix: conflict with apt cookbook on resource name


  • increase max wait time of gitlab to 5 min (better resilience on shared runners)
  • use .gitlab-ci.yml template [20170731]
  • sleep 2s in tests after runner actions (for shared runner)


  • set new contributing guide with karma style
  • remove dependency on yum, set chef version to 12.19



  • Add official support (with tests) for debian 8
  • Fix wait when error is 500 (or anything else)
  • Fix escape tag-list argument
  • Fix escape bool arguments properly
  • Handover maintenance to, update Copyright


  • Stop always executing a converge before a verify
  • Add always_update_cookbooks: true in provisionner config
  • Use latest template for .gitlab-ci.yml [20170405]
  • Set build_pull: download latest test image
  • Use preprovisionned image with chef for gitlab
  • Make tests work on gitlab shared runner: get around the selinux security


  • Fix mistake on provider example in README
  • Fix all rubocop and foodcriti offenses
  • Use cookbook_name "macro" everywhere
  • Fix missing/wrong metadata, set chef-version (>= 12.0)



  • Fix #2: multiple tags are now correctly handled
  • Fix #3: ruby_block resource is always run
  • Fix #6: Make repo URL and gpgkey an attribute
  • Fix #7: Support multiple env strings
  • Add ChefSpec matchers for LWRP


  • Switch to kitchen-docker_cli instead of kitchen-docker
  • Clean kitchen.yml, use instance names & add skip_preparation
  • Add tags in gitlab-ci tests
  • Use Continuous Integration with gitlab-ci
  • Can specify retries in package, set 1 in tests



  • Fix cookbook to work with latest available version of gitlab (8.5) and gitlab-runner (1.0.4)
  • Be completely generic and accept any runner options
    • rename token to registration_token to match runner cli option name


  • Change kitchen driver to docker_cli
  • Use official docker image for gitlab
  • Remove useless monkey patching


  • Fix all rubocop offenses
  • Add license, refactor README and update it
  • Add default attribute 'runners' with a small documentation


  • Initial version with Centos 7 support

Collaborator Number Metric

2.1.0 passed this metric

Contributing File Metric

2.1.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Foodcritic Metric

2.1.0 passed this metric

No Binaries Metric

2.1.0 passed this metric

Testing File Metric

2.1.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Version Tag Metric

2.1.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must include a tag that matches this cookbook version number