Skip to content

Commit

Permalink
Merge pull request #209 from voxpupuli/159-update-git_data_dirs
Browse files Browse the repository at this point in the history
remove git_data_dir
  • Loading branch information
bastelfreak authored Mar 31, 2018
2 parents b5f4da8 + ec10a19 commit f8c27ff
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 26 deletions.
8 changes: 1 addition & 7 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,7 @@
$geo_secondary_role = $::gitlab::geo_secondary_role
$git = $::gitlab::git
$gitaly = $::gitlab::gitaly
$git_data_dir = $::gitlab::git_data_dir
# git_data_dirs is the new way to specify data_dirs, introduced in 8.10
if $git_data_dir {
$git_data_dirs = merge({ 'default' => { 'path' => $::gitlab::git_data_dir} }, $::gitlab::git_data_dirs)
} else {
$git_data_dirs = $::gitlab::git_data_dirs
}
$git_data_dirs = $::gitlab::git_data_dirs
$gitlab_git_http_server = $::gitlab::gitlab_git_http_server
$gitlab_ci = $::gitlab::gitlab_ci
$gitlab_pages = $::gitlab::gitlab_pages
Expand Down
5 changes: 2 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@
# Default: undef
# Hash of 'Gitaly' config parameters.
#
# [*git_data_dir*]
# [*git_data_dirs*]
# Default: undef
# Git data dir
# Hash of git data directories
#
# [*gitlab_git_http_server*]
# Default: undef
Expand Down Expand Up @@ -376,7 +376,6 @@
Boolean $geo_secondary_role = false,
Optional[Hash] $git = undef,
Optional[Hash] $gitaly = undef,
Optional[Stdlib::Absolutepath] $git_data_dir = undef,
Optional[Hash] $git_data_dirs = undef,
Optional[Hash] $gitlab_git_http_server = undef,
Optional[Hash] $gitlab_ci = undef,
Expand Down
18 changes: 8 additions & 10 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,23 +222,21 @@
let(:params) do
{
'git_data_dirs' => {
'default' => '/var/opt/gitlab/data',
'alt' => '/opt/data'
'default' => {
'path' => '/git-data/data'
}
}
}
end

it do
is_expected.to contain_file('/etc/gitlab/gitlab.rb').
with_content(%r{^\s*git_data_dirs\(\{\"alt\"\=\>\"\/opt\/data\"\,\s\"default\"=>\"\/var\/opt\/gitlab\/data\"\}\)})
let(:expected_content) do
{
datadirs: %(git_data_dirs({\"default\"=>{\"path\"=>\"/git-data/data\"}})\n)
}
end
end
describe 'without data_dirs' do
let(:params) { { git_data_dir: '/var/opt/data' } }

it do
is_expected.to contain_file('/etc/gitlab/gitlab.rb').
with_content(%r{"/var/opt/data"})
with_content(%r{\s*#{Regexp.quote(expected_content[:datadirs])}}m)
end
end
describe 'with store_git_keys_in_db' do
Expand Down
6 changes: 0 additions & 6 deletions templates/gitlab.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ external_url '<%= @external_url %>'
<%- if @external_port -%>
external_port '<%= @external_port %>'
<%- end -%>
<%- if @git_data_dir -%>
## For setting up different data storing directory
## see https://gitlab.com/gitlab-org/omnibus-gitlab/blob/629def0a7a26e7c2326566f0758d4a27857b52a3/README.md#storing-git-data-in-an-alternative-directory
## If you want to use a single non-default directory to store git data use:
git_data_dir "<%= @git_data_dir %>"
<%- end -%>
<%- if @git_data_dirs -%>

### For setting up different data storing directory
Expand Down

0 comments on commit f8c27ff

Please sign in to comment.