name 'gitlab-runner'
description 'GitLab-runner'

run_list(
  #'recipe[ssl_cert::ca_certs]',
  'role[docker]',
  'recipe[gitlab-grid::runner-docker-compose]',
)

#env_run_lists()

#default_attributes()

ca_name = 'grid_ca'  # Internal CA

override_attributes(
  'ssl_cert' => {
    'ca_names' => [
      ca_name,
    ],
  },
  'gitlab-grid' => {
    #'with_ssl_cert_cookbook' => true,
    'ssl_cert' => {
      'ca_name' => ca_name,
    },
    'runner-docker-compose' => {
      #'import_ca' => true,
      'config' => {
        'services' => {
          'runner' => {
            'volumes' => [
              # for Docker executor
              '/var/run/docker.sock:/var/run/docker.sock',
            ],
          },
        },
      },
    },
  },
)
