diff --git a/doc/roles/README.md b/doc/roles/README.md index 349367219916e68c98bc19b2a7be817c6d664cda_ZG9jL3JvbGVzL1JFQURNRS5tZA==..e96542ede7d93609d981e78751984abffa941ec0_ZG9jL3JvbGVzL1JFQURNRS5tZA== 100644 --- a/doc/roles/README.md +++ b/doc/roles/README.md @@ -141,4 +141,16 @@ Configures the server with a GitLab Pages instance. - By default, enables no other services. + *By default, enables no other services.* + +### Sidekiq Roles + +Sidekiq roles are used to setup and configure Sidekiq. For additional +information, see the +[Sidekiq Administration documeentation](https://docs.gitlab.com/ee/administration/sidekiq.html) + +- **sidekiq_role** (`gitlab-ce`/`gitlab-ee`) + + Configures the server with Sidekiq service. + + *By default, enables no other services.* diff --git a/files/gitlab-cookbooks/package/libraries/config/gitlab.rb b/files/gitlab-cookbooks/package/libraries/config/gitlab.rb index 349367219916e68c98bc19b2a7be817c6d664cda_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9wYWNrYWdlL2xpYnJhcmllcy9jb25maWcvZ2l0bGFiLnJi..e96542ede7d93609d981e78751984abffa941ec0_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9wYWNrYWdlL2xpYnJhcmllcy9jb25maWcvZ2l0bGFiLnJi 100644 --- a/files/gitlab-cookbooks/package/libraries/config/gitlab.rb +++ b/files/gitlab-cookbooks/package/libraries/config/gitlab.rb @@ -40,6 +40,7 @@ role('patroni').use { PatroniRole } role('consul').use { ConsulRole } role('pages').use { PagesRole } + role('sidekiq').use { SidekiqRole } ## Attributes directly on the node attribute('package').use { Package } diff --git a/files/gitlab-cookbooks/package/libraries/config/roles/sidekiq.rb b/files/gitlab-cookbooks/package/libraries/config/roles/sidekiq.rb new file mode 100644 index 0000000000000000000000000000000000000000..e96542ede7d93609d981e78751984abffa941ec0_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9wYWNrYWdlL2xpYnJhcmllcy9jb25maWcvcm9sZXMvc2lkZWtpcS5yYg== --- /dev/null +++ b/files/gitlab-cookbooks/package/libraries/config/roles/sidekiq.rb @@ -0,0 +1,24 @@ +# Copyright:: Copyright (c) 2021 GitLab Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +module SidekiqRole + def self.load_role + return unless Gitlab['sidekiq_role']['enable'] + + Gitlab['gitlab_rails']['auto_migrate'] ||= false + Services.enable_group('sidekiq_role') + end +end diff --git a/files/gitlab-cookbooks/package/libraries/config/services.rb b/files/gitlab-cookbooks/package/libraries/config/services.rb index 349367219916e68c98bc19b2a7be817c6d664cda_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9wYWNrYWdlL2xpYnJhcmllcy9jb25maWcvc2VydmljZXMucmI=..e96542ede7d93609d981e78751984abffa941ec0_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9wYWNrYWdlL2xpYnJhcmllcy9jb25maWcvc2VydmljZXMucmI= 100644 --- a/files/gitlab-cookbooks/package/libraries/config/services.rb +++ b/files/gitlab-cookbooks/package/libraries/config/services.rb @@ -23,7 +23,7 @@ service 'logrotate', groups: [DEFAULT_GROUP, SYSTEM_GROUP] service 'node_exporter', groups: [DEFAULT_GROUP, SYSTEM_GROUP, 'monitoring', 'monitoring_role'] service 'puma', groups: [DEFAULT_GROUP, 'rails'] - service 'sidekiq', groups: [DEFAULT_GROUP, 'rails', 'sidekiq'] + service 'sidekiq', groups: [DEFAULT_GROUP, 'rails', 'sidekiq', 'sidekiq_role'] service 'gitlab_exporter', groups: [DEFAULT_GROUP, 'rails', 'monitoring'] service 'gitlab_workhorse', groups: [DEFAULT_GROUP, 'rails'] service 'gitaly', groups: [DEFAULT_GROUP, 'rails']