Skip to content

Latest commit

 

History

History
324 lines (174 loc) · 6.28 KB

REFERENCE.md

File metadata and controls

324 lines (174 loc) · 6.28 KB

Reference

Table of Contents

Classes

Public Classes

Private Classes

  • gitlab_ci_runner::config: Manages the configuration of Gitlab runner
  • gitlab_ci_runner::install: Manages the package of Gitlab runner
  • gitlab_ci_runner::repo: Manages the repository for Gitlab runner
  • gitlab_ci_runner::service: Manages the service of Gitlab runner

Defined types

Tasks

Classes

gitlab_ci_runner

This module installs and configures Gitlab CI Runners.

Examples

Simple runner registration
class { 'gitlab_ci_runner':
  runners => {
 	 example_runner => {
 		 'registration-token' => 'gitlab-token',
 		 'url'                => 'https://gitlab.com',
 		 'tag-list'           => 'docker,aws',
 	 },
  },
}

Parameters

The following parameters are available in the gitlab_ci_runner class.

runners

Data type: Hash

Hashkeys are used as $title in runners.pp. The subkeys have to be named as the parameter names from ´gitlab-runner register´ command cause they're later joined to one entire string using 2 hyphen to look like shell command parameters. See ´https://docs.gitlab.com/runner/register/#one-line-registration-command´ for details.

Default value: {}

runner_defaults

Data type: Hash

A hash with defaults which will be later merged with $runners.

Default value: {}

xz_package_name

Data type: String

The name of the 'xz' package. Needed for local docker installations.

concurrent

Data type: Optional[Integer]

Limits how many jobs globally can be run concurrently. The most upper limit of jobs using all defined runners. 0 does not mean unlimited!

Default value: undef

builds_dir

Data type: Optional[String]

Absolute path to a directory where builds will be stored in context of selected executor (Locally, Docker, SSH).

Default value: undef

cache_dir

Data type: Optional[String]

Absolute path to a directory where build caches will be stored in context of selected executor (locally, Docker, SSH). If the docker executor is used, this directory needs to be included in its volumes parameter.

Default value: undef

metrics_server

Data type: Optional[Pattern[/.*:.+/]]

(Deprecated) [host]: to enable metrics server as described in https://docs.gitlab.com/runner/monitoring/README.html#configuration-of-the-metrics-http-server.

Default value: undef

listen_address

Data type: Optional[Pattern[/.*:.+/]]

Address (:) on which the Prometheus metrics HTTP server should be listening.

Default value: undef

sentry_dsn

Data type: Optional[String]

Enable tracking of all system level errors to sentry.

Default value: undef

manage_docker

Data type: Boolean

If docker should be installs (uses the puppetlabs-docker).

Default value: true

manage_repo

Data type: Boolean

If the repository should be managed.

Default value: true

package_ensure

Data type: String

The package 'ensure' state.

Default value: installed

package_name

Data type: String

The name of the package.

Default value: 'gitlab-runner'

repo_base_url

Data type: Stdlib::HTTPUrl

The base repository url.

Default value: 'https://packages.gitlab.com'

repo_keyserver

Data type: Optional[Stdlib::Fqdn]

The keyserver which should be used to get the repository key.

Default value: undef

config_path

Data type: String

The path to the config file of Gitlab runner.

Default value: '/etc/gitlab-runner/config.toml'

Defined types

gitlab_ci_runner::runner

This module installs and configures Gitlab CI Runners.

Examples

Simple runner registration
gitlab_ci_runner::runner { example_runner:
  config => {
    'registration-token' => 'gitlab-token',
    'url'                => 'https://gitlab.com',
    'tag-list'           => 'docker,aws',
  },
}

Parameters

The following parameters are available in the gitlab_ci_runner::runner defined type.

config

Data type: Hash

Hash with configuration options. See https://docs.gitlab.com/runner/configuration/advanced-configuration.html for all possible options.

ensure

Data type: Enum['present', 'absent']

If the runner should be 'present' or 'absent'. Will register/unregister the runner from Gitlab.

Default value: 'present'

runner_name

Data type: String[1]

The name of the runner.

Default value: $title

binary

Data type: String[1]

The name of the Gitlab runner binary.

Default value: 'gitlab-runner'

Tasks

register_runner

Registers a runner on a Gitlab instance.

Supports noop? false

Parameters

url

Data type: String[1]

The url to your Gitlab instance. Please only provide the host part (e.g https://gitlab.com)

token

Data type: String[1]

Registration token.

description

Data type: Optional[String[1]]

Runners description.

info

Data type: Optional[Hash]

Runners metadata.

active

Data type: Optional[Boolean]

Whether the Runner is active.

locked

Data type: Optional[Boolean]

Whether the Runner should be locked for current project.

run_untagged

Data type: Optional[Boolean]

Whether the Runner should handle untagged jobs.

tag_list

Data type: Optional[Array[String[1]]]

List of Runners tags.

access_level

Data type: Optional[Enum['not_protected', 'ref_protected']]

The access_level of the runner.

maximum_timeout

Data type: Optional[Integer[1]]

Maximum timeout set when this Runner will handle the job.

unregister_runner

Unregisters a runner from a Gitlab instance.

Supports noop? false

Parameters

url

Data type: String[1]

The url to your Gitlab instance. Please provide the host part only! (e.g https://gitlab.com)

token

Data type: String[1]

Runners authentication token.