|
| 1 | +# |
| 2 | +# Copyright:: Copyright (c) 2024 GitLab Inc. |
| 3 | +# License:: Apache License, Version 2.0 |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +# |
| 17 | + |
| 18 | +account_helper = AccountHelper.new(node) |
| 19 | +gitlab_user = account_helper.gitlab_user |
| 20 | +gitlab_group = account_helper.gitlab_group |
| 21 | + |
| 22 | +# Holds git-data, by default one shard at /var/opt/gitlab/git-data |
| 23 | +# Can be changed by user using git_data_dirs option |
| 24 | +Mash.new(Gitlab['git_data_dirs']).each do |_name, git_data_directory| |
| 25 | + storage_directory git_data_directory['path'] do |
| 26 | + owner gitlab_user |
| 27 | + group gitlab_group |
| 28 | + mode "0700" |
| 29 | + end |
| 30 | +end |
| 31 | + |
| 32 | +# Holds git repositories, by default at /var/opt/gitlab/git-data/repositories |
| 33 | +# Should not be changed by user. Different permissions to git_data_dir set. |
| 34 | +repositories_storages = node['gitlab']['gitlab_rails']['repositories_storages'] |
| 35 | +repositories_storages.each do |_name, repositories_storage| |
| 36 | + storage_directory repositories_storage['path'] do |
| 37 | + owner gitlab_user |
| 38 | + group gitlab_group |
| 39 | + mode "2770" |
| 40 | + end |
| 41 | +end |
0 commit comments