diff --git a/REFERENCE.md b/REFERENCE.md new file mode 100644 index 00000000..78c18991 --- /dev/null +++ b/REFERENCE.md @@ -0,0 +1,1115 @@ +# Reference + + +## Table of Contents + +**Classes** + +* [`gitlab`](#gitlab): This module installs and configures Gitlab with the Omnibus package. +* [`gitlab::backup`](#gitlabbackup): This class is called from gitlab for backup config. +* [`gitlab::host_config`](#gitlabhost_config): This class is for setting host configurations required for gitlab installation. +* [`gitlab::install`](#gitlabinstall): This class is called from gitlab for install. +* [`gitlab::omnibus_config`](#gitlabomnibus_config): This class is used to configure the gitlab omnibus package on a node +* [`gitlab::omnibus_package_repository`](#gitlabomnibus_package_repository): This class is used to configure gitlab repositories +* [`gitlab::service`](#gitlabservice): This class is meant to be called from gitlab. It ensure the service is running. + +**Defined types** + +* [`gitlab::custom_hook`](#gitlabcustom_hook): Manage custom hook files within a GitLab project. Custom hooks can be created as a pre-receive, post-receive, or update hook. It's possible to create different custom hook types for the same project - one each for pre-receive, post-receive and update. +* [`gitlab::global_hook`](#gitlabglobal_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. + +**Tasks** + +* [`post_upgrade`](#post_upgrade): Cleans up old postgres database after upgrade +* [`postgres_upgrade`](#postgres_upgrade): Upgrades the postgres database if needed + +## 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_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_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_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` + +##### `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` + +##### `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` + +##### `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` + +##### `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_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: `Optional[String]` + + + +Default value: `undef` + +##### `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: {} + +### 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 + +##### `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. It's possible to create different custom hook types for the same project - one each for pre-receive, post-receive and update. + +#### Examples + +##### Custom hook usage + +```puppet +gitlab::custom_hook { 'my_custom_hook': + namespace => 'my_group', + project => 'my_project', + type => 'post-receive', + source => 'puppet:///modules/my_module/post-receive', +} +``` + +#### Parameters + +The following parameters are available in the `gitlab::custom_hook` defined type. + +##### `namespace` + +Data type: `String` + +The GitLab group namespace for the project. + +##### `project` + +Data type: `String` + +The GitLab project name. + +##### `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` + +### 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 + +```puppet +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. + +##### `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` + +## Tasks + +### post_upgrade + +Cleans up old postgres database after upgrade + +**Supports noop?** false + +### postgres_upgrade + +Upgrades the postgres database if needed + +**Supports noop?** false + diff --git a/manifests/backup.pp b/manifests/backup.pp index 3606123b..309542f6 100644 --- a/manifests/backup.pp +++ b/manifests/backup.pp @@ -1,7 +1,4 @@ -# == Class gitlab::backup -# -# This class is called from gitlab for backup config. -# +# @summary This class is called from gitlab for backup config. class gitlab::backup { $rake_exec = $gitlab::rake_exec $backup_cron_enable = $gitlab::backup_cron_enable diff --git a/manifests/custom_hook.pp b/manifests/custom_hook.pp index e5f1be07..35cf3817 100644 --- a/manifests/custom_hook.pp +++ b/manifests/custom_hook.pp @@ -1,47 +1,6 @@ -# == Define: 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. It's possible to create -# different custom hook types for the same project - one each for pre-receive, -# post-receive and update. -# -# === Parameters -# -# [*namevar*] -# The namevar is arbitrary and is not used directly. Supply a descriptive -# namevar of your choosing. -# -# [*namespace*] -# The GitLab group namespace for the project. -# -# [*project*] -# The GitLab project name. -# -# [*type*] -# The custom hook type. Should be one of pre-receive, post-receive, or update. -# -# [*content*] -# 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. -# -# [*source*] -# Specify a file source path to populate the custom hook contents. If this -# paramter is specified content parameter must not be present. -# -# [*repos_path*] -# The GitLab shell repos path. This defaults to -# '/var/opt/gitlab/git-data/repositories' if not present. -# -# [*git_username*] -# The git user name. Defaults to 'git' if not present. -# -# [*git_groupname*] -# The git group name. Defaults to 'git' if not present. -# -# -# === Examples +# @summary Manage custom hook files within a GitLab project. Custom hooks can be created as a pre-receive, post-receive, or update hook. It's possible to create different custom hook types for the same project - one each for pre-receive, post-receive and update. # +# @example Custom hook usage # gitlab::custom_hook { 'my_custom_hook': # namespace => 'my_group', # project => 'my_project', @@ -49,14 +8,12 @@ # source => 'puppet:///modules/my_module/post-receive', # } # -# === Authors -# -# Drew A. Blessing -# -# === Copyright -# -# Copyright 2014 Spencer Owen, unless otherwise noted. -# +# @param namespace The GitLab group namespace for the project. +# @param project The GitLab project name. +# @param type The custom hook type. Should be one of pre-receive, post-receive, or update. +# @param content 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. +# @param source Specify a file source path to populate the custom hook contents. If this paramter is specified content parameter must not be present. +# @param repos_path The GitLab shell repos path. This defaults to '/var/opt/gitlab/git-data/repositories' if not present. define gitlab::custom_hook( String $namespace, String $project, diff --git a/manifests/global_hook.pp b/manifests/global_hook.pp index ed14b5c9..0be00f8f 100644 --- a/manifests/global_hook.pp +++ b/manifests/global_hook.pp @@ -1,57 +1,15 @@ -# == Define: 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. -# -# === Parameters -# -# [*namevar*] -# The namevar is used as chail file name and should be unique. Supply a descriptive -# namevar of your choosing. -# -# [*type*] -# The custom hook type. Should be one of pre-receive, post-receive, or update. -# -# [*content*] -# 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. -# -# [*source*] -# Specify a file source path to populate the custom hook contents. If this -# paramter is specified content parameter must not be present. -# -# [*custom_hooks_dir*] -# The GitLab shell repos path. This defaults to -# '/opt/gitlab/embedded/service/gitlab-shell/hooks' if not present. -# -# [*git_username*] -# The git user name. Defaults to 'git' if not present. -# -# [*git_groupname*] -# The git group name. Defaults to 'git' if not present. -# -# -# === Examples +# @summary 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. # +# @example Global hook usage # gitlab::custom_hook { 'my_custom_hook': # type => 'post-receive', # source => 'puppet:///modules/my_module/post-receive', # } # -# === Authors -# Hidde Boomsma -# -# Inspired by the custom_hook module by: -# Drew A. Blessing -# -# === Copyright -# -# Copyright 2017 Hidde Boomsma -# +# @param type The custom hook type. Should be one of pre-receive, post-receive, or update. +# @param custom_hooks_dir The GitLab shell repos path. This defaults to '/opt/gitlab/embedded/service/gitlab-shell/hooks' if not present. +# @param content 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. +# @param source Specify a file source path to populate the custom hook contents. If this paramter is specified content parameter must not be present. define gitlab::global_hook ( Enum['post-receive', 'pre-receive', 'update'] $type, Stdlib::Absolutepath $custom_hooks_dir, diff --git a/manifests/host_config.pp b/manifests/host_config.pp index ffe2c9b7..79b77f06 100644 --- a/manifests/host_config.pp +++ b/manifests/host_config.pp @@ -1,12 +1,12 @@ -# == Class gitlab::host_config +# @summary This class is for setting host configurations required for gitlab installation. # -# This class is for setting host configurations required for gitlab installation -# -# [*config_dir*] -# Default: '/etc/gitlab' -# 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. +# @param config_dir 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. +# @param skip_auto_migrations Deprecated if using Gitlab > 10.6.4 and < 11.0.0, unsupported by gitlab omnibus using gitlab 11+. Use skip_auto_reconfigure +# @param skip_auto_reconfigure Utilized for Zero Downtime Updates, See: https://docs.gitlab.com/omnibus/update/README.html#zero-downtime-updates +# @param store_git_keys_in_db 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 +# @param pgpass_file_ensure Create .pgpass file for pgbouncer authentication. When set to present requires valid value for pgbouncer_password. +# @param pgpass_file_location Path to location of .pgpass file used by consul to authenticate with pgbouncer database +# @param pgbouncer_password Password for the gitlab-consul database user in the pgbouncer database class gitlab::host_config ( $config_dir = '/etc/gitlab', $skip_auto_migrations = $gitlab::skip_auto_migrations, diff --git a/manifests/init.pp b/manifests/init.pp index 56ecec5a..80b07d9c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,373 +1,92 @@ -# == Class: gitlab -# -# This module installs and configures Gitlab with the Omnibus package. -# -# === Parameters -# -# [*package_ensure*] -# Default: installed -# Can be used to choose exact package version to install. -# -# [*service_name*] -# Default: gitlab-runsvdir -# Name of the system service. -# -# [*service_enable*] -# Default: true -# Run the system service on boot. -# -# [*service_exec*] -# Default: '/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*] -# Default: running -# Should Puppet start the service? -# -# [*service_manage*] -# Default: false -# Should Puppet manage the service? - -# [*service_provider_restart*] -# Default: false -# Should Puppet restart the gitlab systemd service? -# -# [*service_user*] -# Default: root -# Owner of the config file. -# -# [*service_group*] -# Default: root -# Group of the config file. -# -# [*rake_exec*] -# Default: '/usr/bin/gitlab-rake' -# The gitlab-rake executable path. -# You should not need to change this path. -# -# [*edition*] -# **Deprecated**: See `manage_upstream_edition` -# Default: undef -# -# [*manage_upstream_edition*] -# Default: 'ce' -# One of [ 'ce', 'ee', 'disabled' ] -# Manage the installation of an upstream Gitlab Omnibus edition to install. -# -# [*config_manage*] -# Default: true -# Should Puppet manage the config? -# -# [*config_file*] -# Default: /etc/gitlab/gitlab.rb -# Path of the Gitlab Omnibus config file. -# -# [*alertmanager*] -# Default: undef -# Hash of 'alertmanager' config parameters. -# -# [*ci_redis*] -# Default: undef -# Hash of 'ci_redis' config parameters. -# -# [*ci_unicorn*] -# Default: undef -# Hash of 'ci_unicorn' config parameters. -# -# [*external_url*] -# Default: http://$fqdn -# External URL of Gitlab. -# -# [*external_port*] -# Default: undef -# External PORT of Gitlab. -# -# [*geo_postgresql*] -# Default: undef -# Hash of 'geo_postgresql' config parameters. -# -# [*geo_primary_role*] -# Default: false -# Boolean to enable Geo primary role -# -# [*geo_secondary*] -# Default: undef -# Hash of 'geo_secondary' config parameters. -# -# [*geo_secondary_role*] -# Default: false -# Boolean to enable Geo secondary role -# -# [*git*] -# Default: undef -# Hash of 'omnibus_gitconfig' config parameters. -# -# [*gitaly*] -# Default: undef -# Hash of 'Gitaly' config parameters. -# -# [*git_data_dirs*] -# Default: undef -# Hash of git data directories -# -# [*gitlab_git_http_server*] -# Default: undef -# Hash of 'gitlab_git_http_server' config parameters. -# -# [*gitlab_ci*] -# Default: undef -# Hash of 'gitlab_ci' config parameters. -# -# [*gitlab_pages*] -# Default: undef -# Hash of 'gitlab_pages' config parameters. -# -# [*gitlab_rails*] -# Default: undef -# Hash of 'gitlab_rails' config parameters. -# -# [*gitlab_workhorse*] -# Default: undef -# Hash of 'gitlab_workhorse' config parameters. -# -# [*grafana*] -# Default: undef -# Hash of 'grafana' config parameters. -# -# [*logging*] -# Default: undef -# Hash of 'logging' config parameters. -# -# [*letsencrypt*] -# Default: undef -# Hash of 'letsencrypt' config parameters. -# -# [*logrotate*] -# Default: undef -# Hash of 'logrotate' config parameters. -# -# [*manage_storage_directories*] -# Default: undef -# Hash of 'manage_storage_directories' config parameters. -# -# [*manage_accounts*] -# Default: undef -# Hash of 'manage_accounts' config parameters. -# -# [*mattermost_external_url*] -# Default: undef -# External URL of Mattermost. -# -# [*mattermost*] -# Default: undef -# Hash of 'mattmost' config parameters. -# -# [*mattermost_nginx*] -# Default: undef -# Hash of 'mattmost_nginx' config parameters. -# -# [*mattermost_nginx_eq_nginx*] -# Default: false -# Replicate the Mattermost Nginx config from the Gitlab Nginx config. -# -# [*nginx*] -# Default: undef -# Hash of 'nginx' config parameters. -# -# [*node_exporter*] -# Default: undef -# Hash of 'node_exporter' config parameters. -# -# [*redis_exporter*] -# Default: undef -# Hash of 'redis_exporter' config parameters. -# -# [*postgres_exporter*] -# Default: undef -# Hash of 'postgres_exporter' config parameters. -# -# [*gitlab_monitor*] -# Default: 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*] -# Default: undef -# Hash of 'gitlab_exporter' config parameters. -# -# [*pages_external_url*] -# Default: undef -# External URL of Gitlab Pages. -# -# [*pages_nginx*] -# Default: undef -# Hash of 'pages_nginx' config parameters. -# -# [*pages_nginx_eq_nginx*] -# Default: false -# Replicate the Pages Nginx config from the Gitlab Nginx config. -# -# [*postgresql*] -# Default: undef -# Hash of 'postgresql' config parameters. -# -# [*prometheus*] -# Default: undef -# Hash of 'prometheus' config parameters. -# -# [*prometheus_monitoring_enable*] -# Default: undef -# Enable/disable prometheus support. -# -# [*redis*] -# Default: undef -# Hash of 'redis' config parameters. -# -# [*redis_master_role*] -# Default: undef -# To enable Redis master role for the node. -# -# [*redis_slave_role*] -# Default: undef -# To enable Redis slave role for the node. -# -# [*redis_sentinel_role*] -# Default: undef -# To enable sentinel role for the node. -# -# [*registry*] -# Default: undef -# Hash of 'registry' config parameters. -# -# [*registry_external_url*] -# Default: undef -# External URL of Registry -# -# [*registry_nginx*] -# Default: undef -# Hash of 'registry_nginx' config parameters. -# -# [*registry_nginx_eq_nginx*] -# Default: false -# Replicate the registry Nginx config from the Gitlab Nginx config. -# -# [*roles*] -# Default: undef -# Array of roles when using a HA or Geo enabled GitLab configuration -# See: https://docs.gitlab.com/omnibus/roles/README.html for acceptable values -# -# [*sentinel*] -# Default: undef -# Hash of 'sentinel' config parameters. -# -# [*shell*] -# Default: undef -# Hash of 'gitlab_shell' config parameters. -# -# [*sidekiq*] -# Default: undef -# Hash of 'sidekiq' config parameters. -# -# [*sidekiq_cluster*] -# Default: undef -# Hash of 'sidekiq_cluster' config parameters. -# -# [*skip_auto_migrations*] -# Default: 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*] -# Default: undef -# Utilized for Zero Downtime Updates, See: https://docs.gitlab.com/omnibus/update/README.html#zero-downtime-updates -# -# [*skip_post_deployment_migrations*] -# Default: false -# Adds SKIP_POST_DEPLOYMENT_MIGRATIONS=true to the execution of gitlab-ctl reconfigure -# Used for zero-downtime updates -# -# [*store_git_keys_in_db*] -# Default: false -# 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 -# -# -# [*source_config_file*] -# Default: undef -# Override Hiera config with path to gitlab.rb config file. -# -# [*unicorn*] -# Default: undef -# Hash of 'unicorn' config parameters. -# -# [*puma*] -# Default: undef -# Hash of 'puma' config parameters. -# -# [*user*] -# Default: undef -# Hash of 'user' config parameters. -# -# [*web_server*] -# Default: undef -# Hash of 'web_server' config parameters. -# -# [*high_availability*] -# Default: undef -# Hash of 'high_availability' config parameters. -# -# [*backup_cron_enable*] -# Default: false -# Boolean to enable the daily backup cron job -# -# [*backup_cron_minute*] -# Default: 0 -# The minute when to run the daily backup cron job -# -# [*backup_cron_hour*] -# Default: 2 -# The hour when to run the daily backup cron job -# -# [*backup_cron_skips*] -# Default: [] -# Array of items to skip -# valid values: db, uploads, repositories, builds, -# artifacts, lfs, registry, pages -# -# [*package_name*] -# Default: 'gitlab-ce' -# 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*] -# Default: true -# Should the GitLab package be managed? -# -# [*repository_configuration*] -# A hash of repository types and attributes for configuraiton the gitlab package repositories -# See docs in README.md -# -# [*manage_omnibus_repository*] -# Default: true -# Set to false if you wish to manage gitlab without configuring the package repository -# [*pgpass_file_location*] -# Default: '/home/gitlab-consul/.pgpass' -# Path to location of .pgpass file used by consul to -# authenticate with pgbouncer database -# -# [*pgpass_file_ensure*] -# Default: 'absent' -# Create .pgpass file for pgbouncer authentication -# When set to present requires valid value for pgbouncer_password -# -# [*pgbouncer_password*] -# Default: undef -# Password for the gitlab-consul database user in the -# pgbouncer database -# +# @summary This module installs and configures Gitlab with the Omnibus package. +# +# @param package_ensure Can be used to choose exact package version to install. +# @param service_name Name of the system service. +# @param service_enable Run the system service on boot. +# @param service_exec 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. +# @param service_ensure Should Puppet start the service? +# @param service_manage Should Puppet manage the service? +# @param service_provider_restart Should Puppet restart the gitlab systemd service? +# @param service_user Owner of the config file. +# @param service_group Group of the config file. +# @param rake_exec The gitlab-rake executable path. You should not need to change this path. +# @param edition **Deprecated**: See `manage_upstream_edition` +# @param manage_upstream_edition One of [ 'ce', 'ee', 'disabled' ]. Manage the installation of an upstream Gitlab Omnibus edition to install. +# @param config_manage Should Puppet manage the config? +# @param config_file Path of the Gitlab Omnibus config file. +# @param alertmanager Hash of 'alertmanager' config parameters. +# @param ci_redis Hash of 'ci_redis' config parameters. +# @param ci_unicorn Hash of 'ci_unicorn' config parameters. +# @param external_url External URL of Gitlab. +# @param external_port External PORT of Gitlab. +# @param geo_postgresql Hash of 'geo_postgresql' config parameters. +# @param geo_primary_role Boolean to enable Geo primary role +# @param geo_secondary Hash of 'geo_secondary' config parameters. +# @param geo_secondary_role Boolean to enable Geo secondary role +# @param git Hash of 'omnibus_gitconfig' config parameters. +# @param gitaly Hash of 'omnibus_gitconfig' config parameters. +# @param git_data_dirs Hash of git data directories +# @param gitlab_git_http_server Hash of 'gitlab_git_http_server' config parameters. +# @param gitlab_ci Hash of 'gitlab_ci' config parameters. +# @param gitlab_pages Hash of 'gitlab_pages' config parameters. +# @param gitlab_rails Hash of 'gitlab_pages' config parameters. +# @param gitlab_workhorse Hash of 'gitlab_workhorse' config parameters. +# @param grafana Hash of 'grafana' config parameters. +# @param logging Hash of 'logging' config parameters. +# @param letsencrypt Hash of 'letsencrypt' config parameters. +# @param logrotate Hash of 'logrotate' config parameters. +# @param manage_storage_directories Hash of 'manage_storage_directories' config parameters. +# @param manage_accounts Hash of 'manage_accounts' config parameters. +# @param mattermost_external_url External URL of Mattermost. +# @param mattermost Hash of 'mattmost' config parameters. +# @param mattermost_nginx Hash of 'mattmost_nginx' config parameters. +# @param mattermost_nginx_eq_nginx Replicate the Mattermost Nginx config from the Gitlab Nginx config. +# @param nginx Hash of 'nginx' config parameters. +# @param node_exporter Hash of 'node_exporter' config parameters. +# @param redis_exporter Hash of 'redis_exporter' config parameters. +# @param postgres_exporter Hash of 'postgres_exporter' config parameters. +# @param gitlab_monitor Deprecated if using Gitlab > 12.3 and < 13.0, unsupported by gitlab omnibus using Gitlab 13+. Hash of 'gitlab_monitor' config parameters. +# @param gitlab_exporter Hash of 'gitlab_exporter' config parameters. +# @param pages_external_url External URL of Gitlab Pages. +# @param pages_nginx Hash of 'pages_nginx' config parameters. +# @param pages_nginx_eq_nginx Replicate the Pages Nginx config from the Gitlab Nginx config. +# @param postgresql Hash of 'postgresql' config parameters. +# @param prometheus Hash of 'prometheus' config parameters. +# @param prometheus_monitoring_enable Enable/disable prometheus support. +# @param redis Hash of 'redis' config parameters. +# @param redis_master_role To enable Redis master role for the node. +# @param redis_slave_role To enable Redis slave role for the node. +# @param redis_sentinel_role To enable sentinel role for the node. +# @param registry Hash of 'registry' config parameters. +# @param registry_external_url External URL of Registry +# @param registry_nginx Hash of 'registry_nginx' config parameters. +# @param registry_nginx_eq_nginx Replicate the registry Nginx config from the Gitlab Nginx config. +# @param roles Array of roles when using a HA or Geo enabled GitLab configuration. See: https://docs.gitlab.com/omnibus/roles/README.html for acceptable values +# @param sentinel Hash of 'sentinel' config parameters. +# @param shell Hash of 'gitlab_shell' config parameters. +# @param sidekiq Hash of 'sidekiq' config parameters +# @param sidekiq_cluster Hash of 'sidekiq_cluster' config parameters. +# @param skip_auto_migrations Deprecated if using Gitlab > 10.6.4 and < 11.0.0, unsupported by gitlab omnibus using gitlab 11+. Use skip_auto_reconfigure +# @param skip_auto_reconfigure Utilized for Zero Downtime Updates, See: https://docs.gitlab.com/omnibus/update/README.html#zero-downtime-updates +# @param skip_post_deployment_migrations Adds SKIP_POST_DEPLOYMENT_MIGRATIONS=true to the execution of gitlab-ctl reconfigure. Used for zero-downtime updates +# @param store_git_keys_in_db 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 +# @param source_config_file Override Hiera config with path to gitlab.rb config file +# @param unicorn Hash of 'unicorn' config parameters. +# @param puma Hash of 'puma' config parameters. +# @param user Hash of 'user' config parameters. +# @param web_server Hash of 'web_server' config parameters. +# @param high_availability Hash of 'high_availability' config parameters. +# @param backup_cron_enable Boolean to enable the daily backup cron job +# @param backup_cron_minute The minute when to run the daily backup cron job +# @param backup_cron_hour The hour when to run the daily backup cron job +# @param backup_cron_skips Array of items to skip valid values: db, uploads, repositories, builds, artifacts, lfs, registry, pages +# @param package_name 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. +# @param manage_package Should the GitLab package be managed? +# @param repository_configuration A hash of repository types and attributes for configuraiton the gitlab package repositories. See docs in README.md +# @param manage_omnibus_repository Set to false if you wish to manage gitlab without configuring the package repository +# @param pgpass_file_location Path to location of .pgpass file used by consul to authenticate with pgbouncer database +# @param pgpass_file_ensure Create .pgpass file for pgbouncer authentication. When set to present requires valid value for pgbouncer_password. +# @param pgbouncer_password Password for the gitlab-consul database user in the pgbouncer database class gitlab ( Hash $repository_configuration, # package configuration diff --git a/manifests/install.pp b/manifests/install.pp index b7e0e774..7dda41b2 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -1,6 +1,4 @@ -# == Class gitlab::install -# -# This class is called from gitlab for install. +# @summary This class is called from gitlab for install. class gitlab::install ( $package_name = $gitlab::package_name, $package_ensure = $gitlab::package_ensure, diff --git a/manifests/omnibus_config.pp b/manifests/omnibus_config.pp index 34f54fd2..b778af72 100644 --- a/manifests/omnibus_config.pp +++ b/manifests/omnibus_config.pp @@ -1,7 +1,7 @@ -# == Class gitlab::omnibus_config -# -# This class is used to configure the gitlab omnibus package on a node +# @summary This class is used to configure the gitlab omnibus package on a node # +# @param config_manage Should Puppet manage the config? +# @param config_file Path of the Gitlab Omnibus config file. class gitlab::omnibus_config ( $config_manage = $gitlab::config_manage, $config_file = $gitlab::config_file diff --git a/manifests/omnibus_package_repository.pp b/manifests/omnibus_package_repository.pp index 83a52611..e24eb4fe 100644 --- a/manifests/omnibus_package_repository.pp +++ b/manifests/omnibus_package_repository.pp @@ -1,7 +1,8 @@ -# == Class gitlab::repos -# -# This class is used to configure gitlab repositories +# @summary This class is used to configure gitlab repositories # +# @param repository_configuration A hash of repository types and attributes for configuraiton the gitlab package repositories. See docs in README.md +# @param manage_omnibus_repository Set to false if you wish to manage gitlab without configuring the package repository +# @param manage_upstream_edition One of [ 'ce', 'ee', 'disabled' ]. Manage the installation of an upstream Gitlab Omnibus edition to install. class gitlab::omnibus_package_repository ( $repository_configuration = $gitlab::repository_configuration, $manage_omnibus_repository = $gitlab::manage_omnibus_repository, diff --git a/manifests/service.pp b/manifests/service.pp index 65f0120c..14291a44 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -1,8 +1,12 @@ -# == Class gitlab::service -# -# This class is meant to be called from gitlab. -# It ensure the service is running. +# @summary This class is meant to be called from gitlab. It ensure the service is running. # +# @param service_ensure Should Puppet start the service? +# @param service_enable Run the system service on boot. +# @param service_name Name of the system service. +# @param service_exec 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. +# @param service_manage Should Puppet manage the service? +# @param service_provider_restart Should Puppet restart the gitlab systemd service? +# @param skip_post_deployment_migrations Adds SKIP_POST_DEPLOYMENT_MIGRATIONS=true to the execution of gitlab-ctl reconfigure. Used for zero-downtime updates class gitlab::service ( $service_ensure = $gitlab::service_ensure, $service_enable = $gitlab::service_enable,