Skip to content

Add support for passing global-level configuration entries e.g. concurrent

I want my config.toml to look like:

concurrent = 10

[[runners]]
  (populated by gitlab-ci-runner)

For this to happen, I need to create config.toml first, then use gitlab_ci_runner resource to register the runner.

template '/etc/gitlab-runner/config.toml' do
  owner 'root'
  group 'root'
  mode '0600'
  action :create
  source 'gitlab-runner-config.toml'
end

gitlab_ci_runner 'some-name-here' do
  options({
    registration_token: vault_gitlab[:token],
    url: 'https://gitlab.com',
    executor: 'docker',
    docker_image: 'alpine:latest',
  })
end

It'd be nice if global-level configuration entries could be specified within gitlab_ci_runner, e.g.

gitlab_ci_runner 'some-name-here' do
  options({
    registration_token: vault_gitlab[:token],
    url: 'https://gitlab.com',
    executor: 'docker',
    docker_image: 'alpine:latest',
  })
  global({
    concurrent: 10
  })
end

Thanks for maintaining this cookbook, it's very useful!