Commit dd3b1b2d754f7bb2c192b07695db42a5f2e53676
1 parent
1fc65991
Exists in
master
and in
13 other branches
Explain 'gitlab_rails' vs 'gitlab-rails'
Showing
1 changed file
with
9 additions
and
0 deletions
Show diff stats
files/gitlab-cookbooks/gitlab/libraries/gitlab.rb
@@ -16,6 +16,14 @@ | @@ -16,6 +16,14 @@ | ||
16 | # limitations under the License. | 16 | # limitations under the License. |
17 | # | 17 | # |
18 | 18 | ||
19 | +# The Gitlab module in this file is used to parse /etc/gitlab/gitlab.rb. | ||
20 | +# | ||
21 | +# Warning to the reader: | ||
22 | +# Because the Ruby DSL in /etc/gitlab/gitlab.rb does not accept hyphens in | ||
23 | +# section names, this module translates names like 'gitlab_rails' to the | ||
24 | +# correct 'gitlab-rails' in the `generate_hash` method. This module is the only | ||
25 | +# place in the cookbook where we write 'gitlab_rails'. | ||
26 | + | ||
19 | require 'mixlib/config' | 27 | require 'mixlib/config' |
20 | require 'chef/mash' | 28 | require 'chef/mash' |
21 | require 'chef/json_compat' | 29 | require 'chef/json_compat' |
@@ -139,6 +147,7 @@ module Gitlab | @@ -139,6 +147,7 @@ module Gitlab | ||
139 | generate_secrets(node_name) | 147 | generate_secrets(node_name) |
140 | parse_external_url | 148 | parse_external_url |
141 | parse_git_data_dir | 149 | parse_git_data_dir |
150 | + # The last step is to convert underscores to hyphens in top-level keys | ||
142 | generate_hash | 151 | generate_hash |
143 | end | 152 | end |
144 | end | 153 | end |