Puppet Class: gitlab

Defined in:
manifests/init.pp

Summary

This module installs and configures Gitlab with the Omnibus package.

Overview

Parameters:

  • package_ensure (String) (defaults to: 'installed')

    Can be used to choose exact package version to install.

  • service_name (String) (defaults to: 'gitlab-runsvdir')

    Name of the system service.

  • service_enable (Boolean) (defaults to: true)

    Run the system service on boot.

  • service_exec (String) (defaults to: '/usr/bin/gitlab-ctl')

    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.

  • service_ensure (Enum['stopped', 'false', 'running', 'true']) (defaults to: 'running')

    Should Puppet start the service?

  • service_manage (Boolean) (defaults to: false)

    Should Puppet manage the service?

  • service_provider_restart (Boolean) (defaults to: false)

    Should Puppet restart the gitlab systemd service?

  • service_user (String) (defaults to: 'root')

    Owner of the config file.

  • service_group (String) (defaults to: 'root')

    Group of the config file.

  • rake_exec (String) (defaults to: '/usr/bin/gitlab-rake')

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

  • edition (Optional[String]) (defaults to: undef)

    Deprecated: See ‘manage_upstream_edition`

  • manage_upstream_edition (Enum['ce', 'ee', 'disabled']) (defaults to: 'ce')

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

  • config_manage (Boolean) (defaults to: true)

    Should Puppet manage the config?

  • config_file (Stdlib::Absolutepath) (defaults to: '/etc/gitlab/gitlab.rb')

    Path of the Gitlab Omnibus config file.

  • alertmanager (Optional[Hash]) (defaults to: undef)

    Hash of ‘alertmanager’ config parameters.

  • ci_redis (Optional[Hash]) (defaults to: undef)

    Hash of ‘ci_redis’ config parameters.

  • ci_unicorn (Optional[Hash]) (defaults to: undef)

    Hash of ‘ci_unicorn’ config parameters.

  • external_url (Stdlib::Httpurl) (defaults to: "http://${facts['networking']['fqdn']}")

    External URL of Gitlab.

  • external_port (Optional[Integer[1, 65565]]) (defaults to: undef)

    External PORT of Gitlab.

  • geo_postgresql (Optional[Hash]) (defaults to: undef)

    Hash of ‘geo_postgresql’ config parameters.

  • geo_logcursor (Optional[Hash]) (defaults to: undef)

    Hash of ‘geo_logcursor’ config parameters.

  • geo_primary_role (Boolean) (defaults to: false)

    Boolean to enable Geo primary role

  • geo_secondary (Optional[Hash]) (defaults to: undef)

    Hash of ‘geo_secondary’ config parameters.

  • geo_secondary_role (Boolean) (defaults to: false)

    Boolean to enable Geo secondary role

  • git (Optional[Hash]) (defaults to: undef)

    Hash of ‘omnibus_gitconfig’ config parameters.

  • gitaly (Optional[Hash]) (defaults to: undef)

    Hash of ‘omnibus_gitconfig’ config parameters.

  • git_data_dirs (Optional[Hash]) (defaults to: undef)

    Hash of git data directories

  • gitlab_git_http_server (Optional[Hash]) (defaults to: undef)

    Hash of ‘gitlab_git_http_server’ config parameters.

  • gitlab_ci (Optional[Hash]) (defaults to: undef)

    Hash of ‘gitlab_ci’ config parameters.

  • gitlab_kas (Optional[Hash]) (defaults to: undef)

    Hash of ‘gitlab_kas’ config parameters.

  • gitlab_pages (Optional[Hash]) (defaults to: undef)

    Hash of ‘gitlab_pages’ config parameters.

  • gitlab_rails (Optional[Hash]) (defaults to: undef)

    Hash of ‘gitlab_pages’ config parameters.

  • gitlab_sshd (Optional[Hash]) (defaults to: undef)

    Hash of ‘gitlab_sshd’ config parameters.

  • gitlab_workhorse (Optional[Hash]) (defaults to: undef)

    Hash of ‘gitlab_workhorse’ config parameters.

  • grafana (Optional[Hash]) (defaults to: undef)

    Hash of ‘grafana’ config parameters.

  • logging (Optional[Hash]) (defaults to: undef)

    Hash of ‘logging’ config parameters.

  • letsencrypt (Optional[Hash]) (defaults to: undef)

    Hash of ‘letsencrypt’ config parameters.

  • package (Optional[Hash[String[1], Scalar]]) (defaults to: undef)

    Hash of ‘package’ config parameters.

  • logrotate (Optional[Hash]) (defaults to: undef)

    Hash of ‘logrotate’ config parameters.

  • manage_storage_directories (Optional[Hash]) (defaults to: undef)

    Hash of ‘manage_storage_directories’ config parameters.

  • manage_accounts (Optional[Hash]) (defaults to: undef)

    Hash of ‘manage_accounts’ config parameters.

  • mattermost_external_url (Optional[String]) (defaults to: undef)

    External URL of Mattermost.

  • mattermost (Optional[Hash]) (defaults to: undef)

    Hash of ‘mattmost’ config parameters.

  • mattermost_nginx (Optional[Hash]) (defaults to: undef)

    Hash of ‘mattmost_nginx’ config parameters.

  • mattermost_nginx_eq_nginx (Boolean) (defaults to: false)

    Replicate the Mattermost Nginx config from the Gitlab Nginx config.

  • nginx (Optional[Hash]) (defaults to: undef)

    Hash of ‘nginx’ config parameters.

  • node_exporter (Optional[Hash]) (defaults to: undef)

    Hash of ‘node_exporter’ config parameters.

  • redis_exporter (Optional[Hash]) (defaults to: undef)

    Hash of ‘redis_exporter’ config parameters.

  • postgres_exporter (Optional[Hash]) (defaults to: undef)

    Hash of ‘postgres_exporter’ config parameters.

  • pgbouncer_exporter (Optional[Hash]) (defaults to: undef)

    Hash of ‘pgbouncer_exporter’ config parameters.

  • gitlab_monitor (Optional[Hash]) (defaults to: undef)

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

  • gitlab_exporter (Optional[Hash]) (defaults to: undef)

    Hash of ‘gitlab_exporter’ config parameters.

  • pages_external_url (Optional[String]) (defaults to: undef)

    External URL of Gitlab Pages.

  • pages_nginx (Optional[Hash]) (defaults to: undef)

    Hash of ‘pages_nginx’ config parameters.

  • pages_nginx_eq_nginx (Boolean) (defaults to: false)

    Replicate the Pages Nginx config from the Gitlab Nginx config.

  • praefect (Optional[Hash]) (defaults to: undef)

    Hash of ‘praefect’ config parameters.

  • postgresql (Optional[Hash]) (defaults to: undef)

    Hash of ‘postgresql’ config parameters.

  • prometheus (Optional[Hash]) (defaults to: undef)

    Hash of ‘prometheus’ config parameters.

  • prometheus_monitoring_enable (Optional[Boolean]) (defaults to: undef)

    Enable/disable prometheus support.

  • redis (Optional[Hash]) (defaults to: undef)

    Hash of ‘redis’ config parameters.

  • redis_master_role (Optional[Boolean]) (defaults to: undef)

    To enable Redis master role for the node.

  • redis_slave_role (Optional[Boolean]) (defaults to: undef)

    To enable Redis slave role for the node.

  • redis_sentinel_role (Optional[Boolean]) (defaults to: undef)

    To enable sentinel role for the node.

  • registry (Optional[Hash]) (defaults to: undef)

    Hash of ‘registry’ config parameters.

  • registry_external_url (Optional[String]) (defaults to: undef)

    External URL of Registry

  • registry_nginx (Optional[Hash]) (defaults to: undef)

    Hash of ‘registry_nginx’ config parameters.

  • registry_nginx_eq_nginx (Boolean) (defaults to: false)

    Replicate the registry Nginx config from the Gitlab Nginx config.

  • roles (Optional[Array]) (defaults to: undef)

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

  • sentinel (Optional[Hash]) (defaults to: undef)

    Hash of ‘sentinel’ config parameters.

  • shell (Optional[Hash]) (defaults to: undef)

    Hash of ‘gitlab_shell’ config parameters.

  • sidekiq (Optional[Hash]) (defaults to: undef)

    Hash of ‘sidekiq’ config parameters

  • sidekiq_cluster (Optional[Hash]) (defaults to: undef)

    Hash of ‘sidekiq_cluster’ config parameters.

  • skip_auto_migrations (Optional) (defaults to: undef)

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

  • skip_auto_reconfigure (Enum['present', 'absent']) (defaults to: 'absent')

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

  • skip_post_deployment_migrations (Boolean) (defaults to: false)

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

  • store_git_keys_in_db (Boolean) (defaults to: false)

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

  • source_config_file (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    Override Hiera config with path to gitlab.rb config file

  • unicorn (Optional[Hash]) (defaults to: undef)

    Hash of ‘unicorn’ config parameters.

  • puma (Optional[Hash]) (defaults to: undef)

    Hash of ‘puma’ config parameters.

  • user (Optional[Hash]) (defaults to: undef)

    Hash of ‘user’ config parameters.

  • web_server (Optional[Hash]) (defaults to: undef)

    Hash of ‘web_server’ config parameters.

  • high_availability (Optional[Hash]) (defaults to: undef)

    Hash of ‘high_availability’ config parameters.

  • backup_cron_enable (Boolean) (defaults to: false)

    Boolean to enable the daily backup cron job

  • backup_cron_minute (Integer[0,59]) (defaults to: 0)

    The minute when to run the daily backup cron job

  • backup_cron_hour (Integer[0,23]) (defaults to: 2)

    The hour when to run the daily backup cron job

  • backup_cron_skips (Array) (defaults to: [])

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

  • package_hold (Enum['hold', 'none']) (defaults to: 'none')

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

  • package_name (Optional[String]) (defaults to: undef)

    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.

  • manage_package (Boolean) (defaults to: true)

    Should the GitLab package be managed?

  • repository_configuration (Hash)

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

  • manage_omnibus_repository (Boolean) (defaults to: true)

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

  • pgpass_file_location (Stdlib::Absolutepath) (defaults to: '/home/gitlab-consul/.pgpass')

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

  • pgpass_file_ensure (Enum['absent', 'present']) (defaults to: 'absent')

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

  • pgbouncer_password (Optional[String]) (defaults to: undef)

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

  • consul (Optional[Hash]) (defaults to: undef)
  • custom_hooks_dir (Stdlib::Absolutepath) (defaults to: '/opt/gitlab/embedded/service/gitlab-shell/hooks')
  • system_hooks_dir (Stdlib::Absolutepath) (defaults to: '/opt/gitlab/embedded/service/gitlab-rails/file_hooks')
  • pgbouncer (Optional[Hash]) (defaults to: undef)
  • repmgr (Optional[Hash]) (defaults to: undef)
  • custom_hooks (Hash) (defaults to: {})
  • global_hooks (Hash) (defaults to: {})
  • system_hooks (Hash[String[1],Hash[String[1],Any]]) (defaults to: {})


97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'manifests/init.pp', line 97

class gitlab (
  Hash                                $repository_configuration,
  # package configuration
  String                              $package_ensure                  = 'installed',
  Optional[String]                    $edition                         = undef,
  Enum['ce', 'ee', 'disabled']        $manage_upstream_edition         = 'ce',
  Boolean                             $manage_omnibus_repository       = true,
  # system service configuration
  Boolean                             $service_enable                  = true,
  Enum['stopped', 'false', 'running', 'true'] $service_ensure        = 'running', # lint:ignore:quoted_booleans
  Boolean                             $service_manage                  = false,
  Boolean                             $service_provider_restart        = false,
  String                              $service_name                    = 'gitlab-runsvdir',
  String                              $service_exec                    = '/usr/bin/gitlab-ctl',
  String                              $service_user                    = 'root',
  String                              $service_group                   = 'root',
  # gitlab specific
  String                              $rake_exec                       = '/usr/bin/gitlab-rake',
  Optional[Hash]                      $alertmanager                    = undef,
  Optional[Hash]                      $ci_redis                        = undef,
  Optional[Hash]                      $ci_unicorn                      = undef,
  Boolean                             $config_manage                   = true,
  Stdlib::Absolutepath                $config_file                     = '/etc/gitlab/gitlab.rb',
  Optional[Hash]                      $consul                          = undef,
  Stdlib::Absolutepath                $custom_hooks_dir                = '/opt/gitlab/embedded/service/gitlab-shell/hooks',
  Stdlib::Absolutepath                $system_hooks_dir                = '/opt/gitlab/embedded/service/gitlab-rails/file_hooks',
  Stdlib::Httpurl                     $external_url                    = "http://${facts['networking']['fqdn']}",
  Optional[Integer[1, 65565]]         $external_port                   = undef,
  Optional[Hash]                      $geo_postgresql                  = undef,
  Optional[Hash]                      $geo_logcursor                   = undef,
  Boolean                             $geo_primary_role                = false,
  Optional[Hash]                      $geo_secondary                   = undef,
  Boolean                             $geo_secondary_role              = false,
  Optional[Hash]                      $git                             = undef,
  Optional[Hash]                      $gitaly                          = undef,
  Optional[Hash]                      $git_data_dirs                   = undef,
  Optional[Hash]                      $gitlab_git_http_server          = undef,
  Optional[Hash]                      $gitlab_ci                       = undef,
  Optional[Hash]                      $gitlab_kas                      = undef,
  Optional[Hash]                      $gitlab_pages                    = undef,
  Optional[Hash]                      $gitlab_rails                    = undef,
  Optional[Hash]                      $gitlab_sshd                     = undef,
  Optional[Hash]                      $grafana                         = undef,
  Optional[Hash]                      $high_availability               = undef,
  Optional[Hash]                      $logging                         = undef,
  Optional[Hash]                      $letsencrypt                     = undef,
  Optional[Hash[String[1], Scalar]]   $package                         = undef,
  Optional[Hash]                      $logrotate                       = undef,
  Optional[Hash]                      $manage_storage_directories      = undef,
  Optional[Hash]                      $manage_accounts                 = undef,
  Boolean                             $manage_package                  = true,
  Optional[Hash]                      $mattermost                      = undef,
  Optional[String]                    $mattermost_external_url         = undef,
  Optional[Hash]                      $mattermost_nginx                = undef,
  Boolean                             $mattermost_nginx_eq_nginx       = false,
  Optional[Hash]                      $nginx                           = undef,
  Optional[Hash]                      $node_exporter                   = undef,
  Optional[Hash]                      $redis_exporter                  = undef,
  Optional[String]                    $pgbouncer_password              = undef,
  Enum['absent', 'present']           $pgpass_file_ensure              = 'absent',
  Stdlib::Absolutepath                $pgpass_file_location            = '/home/gitlab-consul/.pgpass',
  Optional[Hash]                      $postgres_exporter               = undef,
  Optional[Hash]                      $pgbouncer_exporter              = undef,
  Optional[Hash]                      $gitlab_monitor                  = undef,
  Optional[Hash]                      $gitlab_exporter                 = undef,
  Enum['hold', 'none']                $package_hold                    = 'none',
  Optional[String]                    $package_name                    = undef,
  Optional[String]                    $pages_external_url              = undef,
  Optional[Hash]                      $pages_nginx                     = undef,
  Boolean                             $pages_nginx_eq_nginx            = false,
  Optional[Hash]                      $pgbouncer                       = undef,
  Optional[Hash]                      $postgresql                      = undef,
  Optional[Hash]                      $praefect                        = undef,
  Optional[Hash]                      $prometheus                      = undef,
  Optional[Boolean]                   $prometheus_monitoring_enable    = undef,
  Optional[Hash]                      $redis                           = undef,
  Optional[Boolean]                   $redis_master_role               = undef,
  Optional[Boolean]                   $redis_slave_role                = undef,
  Optional[Boolean]                   $redis_sentinel_role             = undef,
  Optional[Hash]                      $registry                        = undef,
  Optional[String]                    $registry_external_url           = undef,
  Optional[Hash]                      $registry_nginx                  = undef,
  Boolean                             $registry_nginx_eq_nginx         = false,
  Optional[Hash]                      $repmgr                          = undef,
  Optional[Array]                     $roles                           = undef,
  Optional[Hash]                      $sentinel                        = undef,
  Boolean                             $skip_post_deployment_migrations = false,
  Optional[Hash]                      $shell                           = undef,
  Optional[Hash]                      $sidekiq                         = undef,
  Optional[Hash]                      $sidekiq_cluster                 = undef,
  Enum['present', 'absent']           $skip_auto_reconfigure           = 'absent',
  Optional                            $skip_auto_migrations            = undef,
  Optional[Stdlib::Absolutepath]      $source_config_file              = undef,
  Boolean                             $store_git_keys_in_db            = false,
  Optional[Hash]                      $unicorn                         = undef,
  Optional[Hash]                      $puma                            = undef,
  Optional[Hash]                      $gitlab_workhorse                = undef,
  Optional[Hash]                      $user                            = undef,
  Optional[Hash]                      $web_server                      = undef,
  Boolean                             $backup_cron_enable              = false,
  Integer[0,59]                       $backup_cron_minute              = 0,
  Integer[0,23]                       $backup_cron_hour                = 2,
  Array                               $backup_cron_skips               = [],
  Hash                                $custom_hooks                    = {},
  Hash                                $global_hooks                    = {},
  Hash[String[1],Hash[String[1],Any]] $system_hooks                    = {},
) {
  include gitlab::omnibus_package_repository

  contain gitlab::host_config
  contain gitlab::omnibus_config
  contain gitlab::install
  contain gitlab::service

  Class['gitlab::host_config']
  -> Class['gitlab::omnibus_config']
  -> Class['gitlab::install']
  -> Class['gitlab::service']

  $custom_hooks.each |$name, $options| {
    gitlab::custom_hook { $name:
      * => $options,
    }
  }

  $global_hooks.each |$name, $options| {
    gitlab::global_hook { $name:
      * => $options,
    }
  }

  $system_hooks.each |$name, $options| {
    gitlab::system_hook { $name:
      * => $options,
    }
  }
}