Skip to content

Latest commit

 

History

History
1422 lines (782 loc) · 37.3 KB

REFERENCE.md

File metadata and controls

1422 lines (782 loc) · 37.3 KB

Reference

Table of Contents

Classes

Defined types

  • gitlab::custom_hook: Manage custom hook files within a GitLab project. Custom hooks can be created as a pre-receive, post-receive, or update hook. Only one of each is currently supported by this module.
  • gitlab::global_hook: Manage global chain loaded hook files for all GitLab projects. Hooks can be created as a pre-receive, post-receive, or update hook. It's possible to create multipe hooks per type as long as their names are unique. Support for chained (global) hooks is introduced in GitLab Shell 4.1.0 and GitLab 8.15.
  • gitlab::system_hook: A file hook will run on each event so it's up to you to filter events or projects

Tasks

Classes

gitlab

This module installs and configures Gitlab with the Omnibus package.

Parameters

The following parameters are available in the gitlab class:

package_ensure

Data type: String

Can be used to choose exact package version to install.

Default value: 'installed'

service_name

Data type: String

Name of the system service.

Default value: 'gitlab-runsvdir'

service_enable

Data type: Boolean

Run the system service on boot.

Default value: true

service_exec

Data type: String

The service executable path. Provide this variable value only if the service executable path would be a subject of change in future GitLab versions for any reason.

Default value: '/usr/bin/gitlab-ctl'

service_ensure

Data type: Enum['stopped', 'false', 'running', 'true']

Should Puppet start the service?

Default value: 'running'

service_manage

Data type: Boolean

Should Puppet manage the service?

Default value: false

service_provider_restart

Data type: Boolean

Should Puppet restart the gitlab systemd service?

Default value: false

service_user

Data type: String

Owner of the config file.

Default value: 'root'

service_group

Data type: String

Group of the config file.

Default value: 'root'

rake_exec

Data type: String

The gitlab-rake executable path. You should not need to change this path.

Default value: '/usr/bin/gitlab-rake'

edition

Data type: Optional[String]

Deprecated: See manage_upstream_edition

Default value: undef

manage_upstream_edition

Data type: Enum['ce', 'ee', 'disabled']

One of [ 'ce', 'ee', 'disabled' ]. Manage the installation of an upstream Gitlab Omnibus edition to install.

Default value: 'ce'

config_manage

Data type: Boolean

Should Puppet manage the config?

Default value: true

config_file

Data type: Stdlib::Absolutepath

Path of the Gitlab Omnibus config file.

Default value: '/etc/gitlab/gitlab.rb'

alertmanager

Data type: Optional[Hash]

Hash of 'alertmanager' config parameters.

Default value: undef

ci_redis

Data type: Optional[Hash]

Hash of 'ci_redis' config parameters.

Default value: undef

ci_unicorn

Data type: Optional[Hash]

Hash of 'ci_unicorn' config parameters.

Default value: undef

external_url

Data type: Stdlib::Httpurl

External URL of Gitlab.

Default value: "http://${facts['networking']['fqdn']}"

external_port

Data type: Optional[Integer[1, 65565]]

External PORT of Gitlab.

Default value: undef

geo_postgresql

Data type: Optional[Hash]

Hash of 'geo_postgresql' config parameters.

Default value: undef

geo_logcursor

Data type: Optional[Hash]

Hash of 'geo_logcursor' config parameters.

Default value: undef

geo_primary_role

Data type: Boolean

Boolean to enable Geo primary role

Default value: false

geo_secondary

Data type: Optional[Hash]

Hash of 'geo_secondary' config parameters.

Default value: undef

geo_secondary_role

Data type: Boolean

Boolean to enable Geo secondary role

Default value: false

git

Data type: Optional[Hash]

Hash of 'omnibus_gitconfig' config parameters.

Default value: undef

gitaly

Data type: Optional[Hash]

Hash of 'omnibus_gitconfig' config parameters.

Default value: undef

git_data_dirs

Data type: Optional[Hash]

Hash of git data directories

Default value: undef

gitlab_git_http_server

Data type: Optional[Hash]

Hash of 'gitlab_git_http_server' config parameters.

Default value: undef

gitlab_ci

Data type: Optional[Hash]

Hash of 'gitlab_ci' config parameters.

Default value: undef

gitlab_kas

Data type: Optional[Hash]

Hash of 'gitlab_kas' config parameters.

Default value: undef

gitlab_pages

Data type: Optional[Hash]

Hash of 'gitlab_pages' config parameters.

Default value: undef

gitlab_rails

Data type: Optional[Hash]

Hash of 'gitlab_pages' config parameters.

Default value: undef

gitlab_sshd

Data type: Optional[Hash]

Hash of 'gitlab_sshd' config parameters.

Default value: undef

gitlab_workhorse

Data type: Optional[Hash]

Hash of 'gitlab_workhorse' config parameters.

Default value: undef

grafana

Data type: Optional[Hash]

Hash of 'grafana' config parameters.

Default value: undef

logging

Data type: Optional[Hash]

Hash of 'logging' config parameters.

Default value: undef

letsencrypt

Data type: Optional[Hash]

Hash of 'letsencrypt' config parameters.

Default value: undef

package

Data type: Optional[Hash[String[1], Scalar]]

Hash of 'package' config parameters.

Default value: undef

logrotate

Data type: Optional[Hash]

Hash of 'logrotate' config parameters.

Default value: undef

manage_storage_directories

Data type: Optional[Hash]

Hash of 'manage_storage_directories' config parameters.

Default value: undef

manage_accounts

Data type: Optional[Hash]

Hash of 'manage_accounts' config parameters.

Default value: undef

mattermost_external_url

Data type: Optional[String]

External URL of Mattermost.

Default value: undef

mattermost

Data type: Optional[Hash]

Hash of 'mattmost' config parameters.

Default value: undef

mattermost_nginx

Data type: Optional[Hash]

Hash of 'mattmost_nginx' config parameters.

Default value: undef

mattermost_nginx_eq_nginx

Data type: Boolean

Replicate the Mattermost Nginx config from the Gitlab Nginx config.

Default value: false

nginx

Data type: Optional[Hash]

Hash of 'nginx' config parameters.

Default value: undef

node_exporter

Data type: Optional[Hash]

Hash of 'node_exporter' config parameters.

Default value: undef

redis_exporter

Data type: Optional[Hash]

Hash of 'redis_exporter' config parameters.

Default value: undef

postgres_exporter

Data type: Optional[Hash]

Hash of 'postgres_exporter' config parameters.

Default value: undef

pgbouncer_exporter

Data type: Optional[Hash]

Hash of 'pgbouncer_exporter' config parameters.

Default value: undef

gitlab_monitor

Data type: Optional[Hash]

Deprecated if using Gitlab > 12.3 and < 13.0, unsupported by gitlab omnibus using Gitlab 13+. Hash of 'gitlab_monitor' config parameters.

Default value: undef

gitlab_exporter

Data type: Optional[Hash]

Hash of 'gitlab_exporter' config parameters.

Default value: undef

pages_external_url

Data type: Optional[String]

External URL of Gitlab Pages.

Default value: undef

pages_nginx

Data type: Optional[Hash]

Hash of 'pages_nginx' config parameters.

Default value: undef

pages_nginx_eq_nginx

Data type: Boolean

Replicate the Pages Nginx config from the Gitlab Nginx config.

Default value: false

praefect

Data type: Optional[Hash]

Hash of 'praefect' config parameters.

Default value: undef

postgresql

Data type: Optional[Hash]

Hash of 'postgresql' config parameters.

Default value: undef

prometheus

Data type: Optional[Hash]

Hash of 'prometheus' config parameters.

Default value: undef

prometheus_monitoring_enable

Data type: Optional[Boolean]

Enable/disable prometheus support.

Default value: undef

redis

Data type: Optional[Hash]

Hash of 'redis' config parameters.

Default value: undef

redis_master_role

Data type: Optional[Boolean]

To enable Redis master role for the node.

Default value: undef

redis_slave_role

Data type: Optional[Boolean]

To enable Redis slave role for the node.

Default value: undef

redis_sentinel_role

Data type: Optional[Boolean]

To enable sentinel role for the node.

Default value: undef

registry

Data type: Optional[Hash]

Hash of 'registry' config parameters.

Default value: undef

registry_external_url

Data type: Optional[String]

External URL of Registry

Default value: undef

registry_nginx

Data type: Optional[Hash]

Hash of 'registry_nginx' config parameters.

Default value: undef

registry_nginx_eq_nginx

Data type: Boolean

Replicate the registry Nginx config from the Gitlab Nginx config.

Default value: false

roles

Data type: Optional[Array]

Array of roles when using a HA or Geo enabled GitLab configuration. See: https://docs.gitlab.com/omnibus/roles/README.html for acceptable values

Default value: undef

sentinel

Data type: Optional[Hash]

Hash of 'sentinel' config parameters.

Default value: undef

shell

Data type: Optional[Hash]

Hash of 'gitlab_shell' config parameters.

Default value: undef

sidekiq

Data type: Optional[Hash]

Hash of 'sidekiq' config parameters

Default value: undef

sidekiq_cluster

Data type: Optional[Hash]

Hash of 'sidekiq_cluster' config parameters.

Default value: undef

skip_auto_migrations

Data type: Optional

Deprecated if using Gitlab > 10.6.4 and < 11.0.0, unsupported by gitlab omnibus using gitlab 11+. Use skip_auto_reconfigure

Default value: undef

skip_auto_reconfigure

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

Utilized for Zero Downtime Updates, See: https://docs.gitlab.com/omnibus/update/README.html#zero-downtime-updates

Default value: 'absent'

skip_post_deployment_migrations

Data type: Boolean

Adds SKIP_POST_DEPLOYMENT_MIGRATIONS=true to the execution of gitlab-ctl reconfigure. Used for zero-downtime updates

Default value: false

store_git_keys_in_db

Data type: Boolean

Enable or disable Fast Lookup of authorized SSH keys in the database. See: https://docs.gitlab.com/ee/administration/operations/fast_ssh_key_lookup.html

Default value: false

source_config_file

Data type: Optional[Stdlib::Absolutepath]

Override Hiera config with path to gitlab.rb config file

Default value: undef

unicorn

Data type: Optional[Hash]

Hash of 'unicorn' config parameters.

Default value: undef

puma

Data type: Optional[Hash]

Hash of 'puma' config parameters.

Default value: undef

user

Data type: Optional[Hash]

Hash of 'user' config parameters.

Default value: undef

web_server

Data type: Optional[Hash]

Hash of 'web_server' config parameters.

Default value: undef

high_availability

Data type: Optional[Hash]

Hash of 'high_availability' config parameters.

Default value: undef

backup_cron_enable

Data type: Boolean

Boolean to enable the daily backup cron job

Default value: false

backup_cron_minute

Data type: Integer[0,59]

The minute when to run the daily backup cron job

Default value: 0

backup_cron_hour

Data type: Integer[0,23]

The hour when to run the daily backup cron job

Default value: 2

backup_cron_skips

Data type: Array

Array of items to skip valid values: db, uploads, repositories, builds, artifacts, lfs, registry, pages

Default value: []

package_hold

Data type: Enum['hold', 'none']

Wether to hold the specified package version. Available options are 'hold' or 'none'. Defaults to 'none'. Available only for Debian/Solaris package managers.

Default value: 'none'

package_name

Data type: Optional[String]

The internal packaging system's name for the package. This name will automatically be changed by the gitlab::edition parameter. Can be overridden for the purposes of installing custom compiled version of gitlab-omnibus.

Default value: undef

manage_package

Data type: Boolean

Should the GitLab package be managed?

Default value: true

repository_configuration

Data type: Hash

A hash of repository types and attributes for configuraiton the gitlab package repositories. See docs in README.md

manage_omnibus_repository

Data type: Boolean

Set to false if you wish to manage gitlab without configuring the package repository

Default value: true

pgpass_file_location

Data type: Stdlib::Absolutepath

Path to location of .pgpass file used by consul to authenticate with pgbouncer database

Default value: '/home/gitlab-consul/.pgpass'

pgpass_file_ensure

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

Create .pgpass file for pgbouncer authentication. When set to present requires valid value for pgbouncer_password.

Default value: 'absent'

pgbouncer_password

Data type: Optional[String]

Password for the gitlab-consul database user in the pgbouncer database

Default value: undef

consul

Data type: Optional[Hash]

Default value: undef

custom_hooks_dir

Data type: Stdlib::Absolutepath

Default value: '/opt/gitlab/embedded/service/gitlab-shell/hooks'

system_hooks_dir

Data type: Stdlib::Absolutepath

Default value: '/opt/gitlab/embedded/service/gitlab-rails/file_hooks'

pgbouncer

Data type: Optional[Hash]

Default value: undef

repmgr

Data type: Optional[Hash]

Default value: undef

custom_hooks

Data type: Hash

Default value: {}

global_hooks

Data type: Hash

Default value: {}

system_hooks

Data type: Hash[String[1],Hash[String[1],Any]]

Default value: {}

gitlab::backup

This class is called from gitlab for backup config.

gitlab::host_config

This class is for setting host configurations required for gitlab installation.

Parameters

The following parameters are available in the gitlab::host_config class:

config_dir

Data type: Any

The service executable path. Provide this variable value only if the service executable path would be a subject of change in future GitLab versions for any reason.

Default value: '/etc/gitlab'

skip_auto_migrations

Data type: Any

Deprecated if using Gitlab > 10.6.4 and < 11.0.0, unsupported by gitlab omnibus using gitlab 11+. Use skip_auto_reconfigure

Default value: $gitlab::skip_auto_migrations

skip_auto_reconfigure

Data type: Any

Utilized for Zero Downtime Updates, See: https://docs.gitlab.com/omnibus/update/README.html#zero-downtime-updates

Default value: $gitlab::skip_auto_reconfigure

store_git_keys_in_db

Data type: Any

Enable or disable Fast Lookup of authorized SSH keys in the database. See: https://docs.gitlab.com/ee/administration/operations/fast_ssh_key_lookup.html

Default value: $gitlab::store_git_keys_in_db

pgpass_file_ensure

Data type: Any

Create .pgpass file for pgbouncer authentication. When set to present requires valid value for pgbouncer_password.

Default value: $gitlab::pgpass_file_ensure

pgpass_file_location

Data type: Any

Path to location of .pgpass file used by consul to authenticate with pgbouncer database

Default value: $gitlab::pgpass_file_location

pgbouncer_password

Data type: Any

Password for the gitlab-consul database user in the pgbouncer database

Default value: $gitlab::pgbouncer_password

gitlab::install

This class is called from gitlab for install.

Parameters

The following parameters are available in the gitlab::install class:

package_name

Data type: Any

Default value: $gitlab::package_name

package_ensure

Data type: Any

Default value: $gitlab::package_ensure

package_hold

Data type: Any

Default value: $gitlab::package_hold

manage_package

Data type: Any

Default value: $gitlab::manage_package

gitlab::omnibus_config

This class is used to configure the gitlab omnibus package on a node

Parameters

The following parameters are available in the gitlab::omnibus_config class:

config_manage

Data type: Any

Should Puppet manage the config?

Default value: $gitlab::config_manage

config_file

Data type: Any

Path of the Gitlab Omnibus config file.

Default value: $gitlab::config_file

gitlab::omnibus_package_repository

This class is used to configure gitlab repositories

Parameters

The following parameters are available in the gitlab::omnibus_package_repository class:

repository_configuration

Data type: Any

A hash of repository types and attributes for configuraiton the gitlab package repositories. See docs in README.md

Default value: $gitlab::repository_configuration

manage_omnibus_repository

Data type: Any

Set to false if you wish to manage gitlab without configuring the package repository

Default value: $gitlab::manage_omnibus_repository

manage_upstream_edition

Data type: Any

One of [ 'ce', 'ee', 'disabled' ]. Manage the installation of an upstream Gitlab Omnibus edition to install.

Default value: $gitlab::manage_upstream_edition

gitlab::service

This class is meant to be called from gitlab. It ensure the service is running.

Parameters

The following parameters are available in the gitlab::service class:

service_ensure

Data type: Any

Should Puppet start the service?

Default value: $gitlab::service_ensure

service_enable

Data type: Any

Run the system service on boot.

Default value: $gitlab::service_enable

service_name

Data type: Any

Name of the system service.

Default value: $gitlab::service_name

service_exec

Data type: Any

The service executable path. Provide this variable value only if the service executable path would be a subject of change in future GitLab versions for any reason.

Default value: $gitlab::service_exec

service_manage

Data type: Any

Should Puppet manage the service?

Default value: $gitlab::service_manage

service_provider_restart

Data type: Any

Should Puppet restart the gitlab systemd service?

Default value: $gitlab::service_provider_restart

skip_post_deployment_migrations

Data type: Any

Adds SKIP_POST_DEPLOYMENT_MIGRATIONS=true to the execution of gitlab-ctl reconfigure. Used for zero-downtime updates

Default value: $gitlab::skip_post_deployment_migrations

Defined types

gitlab::custom_hook

Manage custom hook files within a GitLab project. Custom hooks can be created as a pre-receive, post-receive, or update hook. Only one of each is currently supported by this module.

Examples

Custom hook usage
gitlab::custom_hook { 'my_custom_hook':
  namespace      => 'my_group',
  project        => 'my_project',
  type           => 'post-receive',
  source         => 'puppet:///modules/my_module/post-receive',
}
Calculate hashed storage path
gitlab::custom_hook { 'my_custom_hook':
  project        => 93,
  hashed_storage => true,
  type           => 'post-receive',
  source         => 'puppet:///modules/my_module/post-receive',
}
# Hook path will be `@hashed/6e/40/6e4001871c0cf27c7634ef1dc478408f642410fd3a444e2a88e301f5c4a35a4d`

Parameters

The following parameters are available in the gitlab::custom_hook defined type:

project

Data type: Variant[String,Integer]

The GitLab project name, or the hashed directory name or project ID number

namespace

Data type: Optional[String]

The GitLab group namespace for the project.

Default value: undef

type

Data type: Enum['update', 'post-receive', 'pre-receive']

The custom hook type. Should be one of pre-receive, post-receive, or update.

content

Data type: Optional[String]

Specify the custom hook contents either as a string or using the template function. If this paramter is specified source parameter must not be present.

Default value: undef

source

Data type: Optional[String]

Specify a file source path to populate the custom hook contents. If this paramter is specified content parameter must not be present.

Default value: undef

repos_path

Data type: Optional[Stdlib::Absolutepath]

The GitLab shell repos path. This defaults to '/var/opt/gitlab/git-data/repositories' if not present.

Default value: undef

hashed_storage

Data type: Boolean

Whether to treat the project name as a hashed storage directory name or ID number

Default value: false

gitlab::global_hook

Manage global chain loaded hook files for all GitLab projects. Hooks can be created as a pre-receive, post-receive, or update hook. It's possible to create multipe hooks per type as long as their names are unique. Support for chained (global) hooks is introduced in GitLab Shell 4.1.0 and GitLab 8.15.

Examples

Global hook usage
gitlab::custom_hook { 'my_custom_hook':
  type            => 'post-receive',
  source          => 'puppet:///modules/my_module/post-receive',
}

Parameters

The following parameters are available in the gitlab::global_hook defined type:

type

Data type: Enum['post-receive', 'pre-receive', 'update']

The custom hook type. Should be one of pre-receive, post-receive, or update.

custom_hooks_dir

Data type: Stdlib::Absolutepath

The GitLab shell repos path. This defaults to '/opt/gitlab/embedded/service/gitlab-shell/hooks' if not present.

Default value: $gitlab::custom_hooks_dir

content

Data type: Optional[String[1]]

Specify the custom hook contents either as a string or using the template function. If this paramter is specified source parameter must not be present.

Default value: undef

source

Data type: Optional[Pattern[/^puppet:/]]

Specify a file source path to populate the custom hook contents. If this paramter is specified content parameter must not be present.

Default value: undef

gitlab::system_hook

within a file hook code. You can have as many file hooks as you want. Each file hook will be triggered by GitLab asynchronously in case of an event. For a list of events see the system hooks documentation.

Examples

System hook usage
gitlab::system_hook { 'my_system_hook':
  type            => 'post-receive',
  source          => 'puppet:///modules/my_module/post-receive',
}

Parameters

The following parameters are available in the gitlab::system_hook defined type:

system_hooks_dir

Data type: Stdlib::Absolutepath

The GitLab shell repos path. This defaults to '/opt/gitlab/embedded/service/gitlab-rails/file_hooks' if not present.

Default value: $gitlab::system_hooks_dir

content

Data type: Optional[String[1]]

Specify the system hook contents either as a string or using the template function. If this paramter is specified source parameter must not be present.

Default value: undef

source

Data type: Optional[Pattern[/^puppet:/]]

Specify a file source path to populate the system hook contents. If this paramter is specified content parameter must not be present.

Default value: undef

Tasks

post_upgrade

Cleans up old postgres database after upgrade

Supports noop? false

postgres_upgrade

Upgrades the postgres database if needed

Supports noop? false