Commit 504ffc1ffcf9537de838048bc1f7a1b00cd91e51
1 parent
79e43260
Exists in
master
and in
17 other branches
Insert attributes into gitlab.yml template
Showing
2 changed files
with
72 additions
and
66 deletions
Show diff stats
files/gitlab-cookbooks/gitlab/attributes/default.rb
... | ... | @@ -65,10 +65,12 @@ default['gitlab']['gitlab-rails']['gitlab_default_projects_features_wiki'] = tru |
65 | 65 | default['gitlab']['gitlab-rails']['gitlab_default_projects_features_wall'] = false |
66 | 66 | default['gitlab']['gitlab-rails']['gitlab_default_projects_features_snippets'] = false |
67 | 67 | default['gitlab']['gitlab-rails']['gitlab_default_projects_features_visibility_level'] = "private" |
68 | +default['gitlab']['gitlab-rails']['issues_tracker_redmine'] = false | |
68 | 69 | default['gitlab']['gitlab-rails']['issues_tracker_redmine_title'] = "Redmine" |
69 | 70 | default['gitlab']['gitlab-rails']['issues_tracker_redmine_project_url'] = "http://redmine.sample/projects/:issues_tracker_id" |
70 | 71 | default['gitlab']['gitlab-rails']['issues_tracker_redmine_issues_url'] = "http://redmine.sample/issues/:id" |
71 | 72 | default['gitlab']['gitlab-rails']['issues_tracker_redmine_new_issue_url'] = "http://redmine.sample/projects/:issues_tracker_id/issues/new" |
73 | +default['gitlab']['gitlab-rails']['issues_tracker_jira'] = false | |
72 | 74 | default['gitlab']['gitlab-rails']['issues_tracker_jira_title'] = "Atlassian Jira" |
73 | 75 | default['gitlab']['gitlab-rails']['issues_tracker_jira_project_url'] = "http://jira.sample/issues/?jql=project=:issues_tracker_id" |
74 | 76 | default['gitlab']['gitlab-rails']['issues_tracker_jira_issues_url'] = "http://jira.sample/browse/:id" |
... | ... | @@ -87,12 +89,12 @@ default['gitlab']['gitlab-rails']['ldap_password'] = "_the_password_of_the_bind_ |
87 | 89 | default['gitlab']['gitlab-rails']['ldap_allow_username_or_email_login'] = true |
88 | 90 | default['gitlab']['gitlab-rails']['satellites_path'] = "/var/opt/gitlab/gitlab-satellites" |
89 | 91 | default['gitlab']['gitlab-rails']['backup_path'] = "tmp/backups" |
90 | -default['gitlab']['gitlab-rails']['gitlab_shell_path'] = "/home/git/gitlab-shell/" | |
92 | +default['gitlab']['gitlab-rails']['gitlab_shell_path'] = "/opt/gitlab/embedded/service/gitlab-shell/" | |
91 | 93 | default['gitlab']['gitlab-rails']['gitlab_shell_repos_path'] = "/home/git/repositories/" |
92 | -default['gitlab']['gitlab-rails']['gitlab_shell_hooks_path'] = "/home/git/gitlab-shell/hooks/" | |
94 | +default['gitlab']['gitlab-rails']['gitlab_shell_hooks_path'] = "/opt/gitlab/embedded/service/gitlab-shell/hooks/" | |
93 | 95 | default['gitlab']['gitlab-rails']['gitlab_shell_upload_pack'] = true |
94 | 96 | default['gitlab']['gitlab-rails']['gitlab_shell_receive_pack'] = true |
95 | -default['gitlab']['gitlab-rails']['git_bin_path'] = "/usr/bin/git" | |
97 | +default['gitlab']['gitlab-rails']['git_bin_path'] = "/opt/gitlab/embedded/bin/git" | |
96 | 98 | default['gitlab']['gitlab-rails']['git_max_size'] = 5242880 |
97 | 99 | default['gitlab']['gitlab-rails']['git_timeout'] = 10 |
98 | 100 | default['gitlab']['gitlab-rails']['extra'] = | ... | ... |
files/gitlab-cookbooks/gitlab/templates/default/gitlab.yml.erb
... | ... | @@ -15,9 +15,9 @@ production: &base |
15 | 15 | ## GitLab settings |
16 | 16 | gitlab: |
17 | 17 | ## Web server settings (note: host is the FQDN, do not include http://) |
18 | - host: <%= node['gitlab']['gitlab-rails']['gitlab_host'] %> | |
19 | - port: <%= node['gitlab']['gitlab-rails']['gitlab_port'] %> | |
20 | - https: <%= node['gitlab']['gitlab-rails']['gitlab_https'] %> | |
18 | + host: <%= @gitlab_host %> | |
19 | + port: <%= @gitlab_port %> | |
20 | + https: <%= @gitlab_https %> | |
21 | 21 | |
22 | 22 | # Uncomment and customize the last line to run in a non-root path |
23 | 23 | # WARNING: We recommend creating a FQDN to host GitLab in a root path instead of this. |
... | ... | @@ -35,27 +35,27 @@ production: &base |
35 | 35 | |
36 | 36 | ## Email settings |
37 | 37 | # Email address used in the "From" field in mails sent by GitLab |
38 | - email_from: <%= node['gitlab']['gitlab-rails']['gitlab_email_from'] %> | |
38 | + email_from: <%= @gitlab_email_from %> | |
39 | 39 | |
40 | 40 | # Email address of your support contact (default: same as email_from) |
41 | - support_email: <%= node['gitlab']['gitlab-rails']['gitlab_support_email'] %> | |
41 | + support_email: <%= @gitlab_support_email %> | |
42 | 42 | |
43 | 43 | ## User settings |
44 | 44 | default_projects_limit: 10 |
45 | - # default_can_create_group: false # default: true | |
46 | - # username_changing_enabled: false # default: true - User can change her username/namespace | |
45 | + default_can_create_group: <%= @gitlab_default_can_create_group %> # default: true | |
46 | + username_changing_enabled: <%= @username_changing_enabled %> # default: true - User can change her username/namespace | |
47 | 47 | ## Default theme |
48 | 48 | ## BASIC = 1 |
49 | 49 | ## MARS = 2 |
50 | 50 | ## MODERN = 3 |
51 | 51 | ## GRAY = 4 |
52 | 52 | ## COLOR = 5 |
53 | - # default_theme: 2 # default: 2 | |
53 | + default_theme: <%= @gitlab_default_theme %> # default: 2 | |
54 | 54 | |
55 | 55 | |
56 | 56 | ## Users management |
57 | 57 | # default: false - Account passwords are not sent via the email if signup is enabled. |
58 | - # signup_enabled: true | |
58 | + signup_enabled: <%= @gitlab_signup_enabled %> | |
59 | 59 | |
60 | 60 | # Restrict setting visibility levels for non-admin users. |
61 | 61 | # The default is to allow all levels. |
... | ... | @@ -69,47 +69,51 @@ production: &base |
69 | 69 | |
70 | 70 | ## Default project features settings |
71 | 71 | default_projects_features: |
72 | - issues: true | |
73 | - merge_requests: true | |
74 | - wiki: true | |
75 | - wall: false | |
76 | - snippets: false | |
77 | - visibility_level: "private" # can be "private" | "internal" | "public" | |
72 | + issues: <%= @gitlab_default_projects_features_issues %> | |
73 | + merge_requests: <%= @gitlab_default_projects_features_merge_requests %> | |
74 | + wiki: <%= @gitlab_default_projects_features_wiki %> | |
75 | + wall: <%= @gitlab_default_projects_features_wall %> | |
76 | + snippets: <%= @gitlab_default_projects_features_snippets %> | |
77 | + visibility_level: "<%= @gitlab_default_projects_features_visibility_level %>" # can be "private" | "internal" | "public" | |
78 | 78 | |
79 | 79 | ## External issues trackers |
80 | 80 | issues_tracker: |
81 | - # redmine: | |
82 | - # title: "Redmine" | |
83 | - # ## If not nil, link 'Issues' on project page will be replaced with this | |
84 | - # ## Use placeholders: | |
85 | - # ## :project_id - GitLab project identifier | |
86 | - # ## :issues_tracker_id - Project Name or Id in external issue tracker | |
87 | - # project_url: "http://redmine.sample/projects/:issues_tracker_id" | |
88 | - # | |
89 | - # ## If not nil, links from /#\d/ entities from commit messages will replaced with this | |
90 | - # ## Use placeholders: | |
91 | - # ## :project_id - GitLab project identifier | |
92 | - # ## :issues_tracker_id - Project Name or Id in external issue tracker | |
93 | - # ## :id - Issue id (from commit messages) | |
94 | - # issues_url: "http://redmine.sample/issues/:id" | |
95 | - # | |
96 | - # ## If not nil, linkis to creating new issues will be replaced with this | |
97 | - # ## Use placeholders: | |
98 | - # ## :project_id - GitLab project identifier | |
99 | - # ## :issues_tracker_id - Project Name or Id in external issue tracker | |
100 | - # new_issue_url: "http://redmine.sample/projects/:issues_tracker_id/issues/new" | |
101 | - # | |
102 | - # jira: | |
103 | - # title: "Atlassian Jira" | |
104 | - # project_url: "http://jira.sample/issues/?jql=project=:issues_tracker_id" | |
105 | - # issues_url: "http://jira.sample/browse/:id" | |
106 | - # new_issue_url: "http://jira.sample/secure/CreateIssue.jspa" | |
81 | + <% if @issues_tracker_redmine %> | |
82 | + redmine: | |
83 | + title: "<%= @issues_tracker_redmine_title %>" | |
84 | + ## If not nil, link 'Issues' on project page will be replaced with this | |
85 | + ## Use placeholders: | |
86 | + ## :project_id - GitLab project identifier | |
87 | + ## :issues_tracker_id - Project Name or Id in external issue tracker | |
88 | + project_url: "<%= @issues_tracker_redmine_project_url %>" | |
89 | + | |
90 | + ## If not nil, links from /#\d/ entities from commit messages will replaced with this | |
91 | + ## Use placeholders: | |
92 | + ## :project_id - GitLab project identifier | |
93 | + ## :issues_tracker_id - Project Name or Id in external issue tracker | |
94 | + ## :id - Issue id (from commit messages) | |
95 | + issues_url: "<%= @issues_tracker_redmine_issues_url %>" | |
96 | + | |
97 | + ## If not nil, linkis to creating new issues will be replaced with this | |
98 | + ## Use placeholders: | |
99 | + ## :project_id - GitLab project identifier | |
100 | + ## :issues_tracker_id - Project Name or Id in external issue tracker | |
101 | + new_issue_url: "<%= @issues_tracker_redmine_new_issue_url %>" | |
102 | + <% end %> | |
103 | + | |
104 | + <% if @issues_tracker_jira %> | |
105 | + jira: | |
106 | + title: "<%= @issues_tracker_jira_title %>" | |
107 | + project_url: "<%= @issues_tracker_jira_project_url %>" | |
108 | + issues_url: "<%= @issues_tracker_jira_issues_url %>" | |
109 | + new_issue_url: "<%= @issues_tracker_jira_new_issue_url %>" | |
110 | + <% end %> | |
107 | 111 | |
108 | 112 | ## Gravatar |
109 | 113 | gravatar: |
110 | - enabled: true # Use user avatar image from Gravatar.com (default: true) | |
111 | - # plain_url: "http://..." # default: http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm | |
112 | - # ssl_url: "https://..." # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm | |
114 | + enabled: <%= @gravatar_enabled %> # Use user avatar image from Gravatar.com (default: true) | |
115 | + plain_url: "<%= @gravatar_plain_url %>" # default: http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm | |
116 | + ssl_url: "<%= @gravatar_ssl_url %>" # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm | |
113 | 117 | |
114 | 118 | # |
115 | 119 | # 2. Auth settings |
... | ... | @@ -119,14 +123,14 @@ production: &base |
119 | 123 | # You can inspect a sample of the LDAP users with login access by running: |
120 | 124 | # bundle exec rake gitlab:ldap:check RAILS_ENV=production |
121 | 125 | ldap: |
122 | - enabled: false | |
123 | - host: '_your_ldap_server' | |
124 | - base: '_the_base_where_you_search_for_users' | |
125 | - port: 636 | |
126 | - uid: 'sAMAccountName' | |
127 | - method: 'ssl' # "tls" or "ssl" or "plain" | |
128 | - bind_dn: '_the_full_dn_of_the_user_you_will_bind_with' | |
129 | - password: '_the_password_of_the_bind_user' | |
126 | + enabled: <%= @ldap_enabled %> | |
127 | + host: '<%= @ldap_host %>' | |
128 | + base: '<%= @ldap_base %>' | |
129 | + port: <%= @ldap_port %> | |
130 | + uid: '<%= @ldap_uid %>' | |
131 | + method: '<%= @ldap_method %>' # "tls" or "ssl" or "plain" | |
132 | + bind_dn: '<%= @ldap_bind_dn %>' | |
133 | + password: '<%= @ldap_password %>' | |
130 | 134 | # If allow_username_or_email_login is enabled, GitLab will ignore everything |
131 | 135 | # after the first '@' in the LDAP username submitted by the user on login. |
132 | 136 | # |
... | ... | @@ -136,7 +140,7 @@ production: &base |
136 | 140 | # |
137 | 141 | # If you are using "uid: 'userPrincipalName'" on ActiveDirectory you need to |
138 | 142 | # disable this setting, because the userPrincipalName contains an '@'. |
139 | - allow_username_or_email_login: true | |
143 | + allow_username_or_email_login: <%= @ldap_allow_username_or_email_login %> | |
140 | 144 | |
141 | 145 | ## OmniAuth settings |
142 | 146 | omniauth: |
... | ... | @@ -175,24 +179,24 @@ production: &base |
175 | 179 | # GitLab Satellites |
176 | 180 | satellites: |
177 | 181 | # Relative paths are relative to Rails.root (default: tmp/repo_satellites/) |
178 | - path: <%= node['gitlab']['gitlab-rails']['satellites_path'] %> | |
182 | + path: <%= @satellites_path %> | |
179 | 183 | |
180 | 184 | ## Backup settings |
181 | 185 | backup: |
182 | - path: "tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/) | |
186 | + path: "<%= @backup_path %>" # Relative paths are relative to Rails.root (default: tmp/backups/) | |
183 | 187 | # keep_time: 604800 # default: 0 (forever) (in seconds) |
184 | 188 | |
185 | 189 | ## GitLab Shell settings |
186 | 190 | gitlab_shell: |
187 | - path: /opt/gitlab/embedded/service/gitlab-shell/ | |
191 | + path: <%= @gitlab_shell_path %> | |
188 | 192 | |
189 | 193 | # REPOS_PATH MUST NOT BE A SYMLINK!!! |
190 | - repos_path: <%= node['gitlab']['gitlab-rails']['gitlab_shell_repos_path'] %> | |
191 | - hooks_path: /opt/gitlab/embedded/service/gitlab-shell/hooks/ | |
194 | + repos_path: <%= @gitlab_shell_repos_path %> | |
195 | + hooks_path: <%= @gitlab_shell_hooks_path %> | |
192 | 196 | |
193 | 197 | # Git over HTTP |
194 | - upload_pack: true | |
195 | - receive_pack: true | |
198 | + upload_pack: <%= @gitlab_shell_upload_pack %> | |
199 | + receive_pack: <%= @gitlab_shell_receive_pack %> | |
196 | 200 | |
197 | 201 | # If you use non-standard ssh port you need to specify it |
198 | 202 | # ssh_port: 22 |
... | ... | @@ -201,13 +205,13 @@ production: &base |
201 | 205 | # CAUTION! |
202 | 206 | # Use the default values unless you really know what you are doing |
203 | 207 | git: |
204 | - bin_path: /opt/gitlab/embedded/bin/git | |
208 | + bin_path: <%= @git_bin_path %> | |
205 | 209 | # The next value is the maximum memory size grit can use |
206 | 210 | # Given in number of bytes per git object (e.g. a commit) |
207 | 211 | # This value can be increased if you have very large commits |
208 | - max_size: 5242880 # 5.megabytes | |
212 | + max_size: <%= @git_max_size %> # 5.megabytes | |
209 | 213 | # Git timeout to read a commit, in seconds |
210 | - timeout: 10 | |
214 | + timeout: <%= @git_timeout %> | |
211 | 215 | |
212 | 216 | # |
213 | 217 | # 4. Extra customization | ... | ... |