From 9b55cc200a016f0049a4476df0d0cc21bc2588ed Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Fri, 9 Oct 2015 14:11:03 +0100 Subject: [PATCH] allow disabling of omnibus user management --- manifests/config.pp | 1 + manifests/init.pp | 6 ++++++ templates/gitlab.rb.erb | 10 ++++++++++ 3 files changed, 17 insertions(+) diff --git a/manifests/config.pp b/manifests/config.pp index 143c6a23..7db1138b 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -20,6 +20,7 @@ $high_availability = $::gitlab::high_availability $logging = $::gitlab::logging $logrotate = $::gitlab::logrotate + $manage_accounts = $::gitlab::manage_accounts $mattermost = $::gitlab::mattermost $mattermost_external_url = $::gitlab::mattermost_external_url $mattermost_nginx = $::gitlab::mattermost_nginx diff --git a/manifests/init.pp b/manifests/init.pp index 7e265bc6..0761fb82 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -104,6 +104,10 @@ # Default: undef # Hash of 'logrotate' config parameters. # +# [*manage_accounts*] +# Default: undef +# Hash of 'manage_accounts' config parameters. +# # [*mattermost_external_url*] # Default: undef # External URL of Mattermost. @@ -213,6 +217,7 @@ $high_availability = undef, $logging = undef, $logrotate = undef, + $manage_accounts = undef, $mattermost = undef, $mattermost_external_url = undef, $mattermost_nginx = undef, @@ -266,6 +271,7 @@ if $user { validate_hash($user) } if $web_server { validate_hash($web_server) } if $high_availability { validate_hash($high_availability) } + if $manage_accounts { validate_hash($manage_accounts) } class { '::gitlab::install': } -> class { '::gitlab::config': } ~> diff --git a/templates/gitlab.rb.erb b/templates/gitlab.rb.erb index 51542eb1..14b71c5d 100644 --- a/templates/gitlab.rb.erb +++ b/templates/gitlab.rb.erb @@ -250,3 +250,13 @@ mattermost['<%= k -%>'] = <%= decorate(@mattermost[k]) %> <%- @mattermost_nginx.keys.sort.each do |k| -%> mattermost_nginx['<%= k -%>'] = <%= decorate(@mattermost_nginx[k]) %> <%- end end -%> +<%- if @manage_accounts -%> + +################### +# Manage Accounts # +################### +## see: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/configuration.md#disable-user-and-group-account-management + +<%- @manage_accounts.keys.sort.each do |k| -%> +manage_accounts['<%= k -%>'] = <%= decorate(@manage_accounts[k]) %> +<%- end end -%>