Commit d6e20d8d87161c07acf2e5c304ef3713dfdd114b
Exists in
master
and in
17 other branches
Merge branch 'git_user' into 'master'
Git User
Showing
3 changed files
with
40 additions
and
0 deletions
Show diff stats
files/gitlab-cookbooks/gitlab/attributes/default.rb
| @@ -17,6 +17,17 @@ | @@ -17,6 +17,17 @@ | ||
| 17 | 17 | ||
| 18 | default['gitlab']['bootstrap']['enable'] = true | 18 | default['gitlab']['bootstrap']['enable'] = true |
| 19 | 19 | ||
| 20 | +#### | ||
| 21 | +# The Git User that services run as | ||
| 22 | +#### | ||
| 23 | +# The username for the chef services user | ||
| 24 | +default['gitlab']['user']['username'] = "git" | ||
| 25 | +# The shell for the chef services user | ||
| 26 | +default['gitlab']['user']['shell'] = "/bin/sh" | ||
| 27 | +# The home directory for the chef services user | ||
| 28 | +default['gitlab']['user']['home'] = "/var/opt/gitlab" | ||
| 29 | + | ||
| 30 | + | ||
| 20 | ### | 31 | ### |
| 21 | # PostgreSQL | 32 | # PostgreSQL |
| 22 | ### | 33 | ### |
files/gitlab-cookbooks/gitlab/recipes/default.rb
| @@ -44,6 +44,8 @@ directory "/var/opt/gitlab" do | @@ -44,6 +44,8 @@ directory "/var/opt/gitlab" do | ||
| 44 | action :create | 44 | action :create |
| 45 | end | 45 | end |
| 46 | 46 | ||
| 47 | +include_recipe "gitlab::users" | ||
| 48 | + | ||
| 47 | # Install our runit instance | 49 | # Install our runit instance |
| 48 | include_recipe "runit" | 50 | include_recipe "runit" |
| 49 | 51 |
| @@ -0,0 +1,27 @@ | @@ -0,0 +1,27 @@ | ||
| 1 | +# | ||
| 2 | +# Copyright:: Copyright (c) 2012 Opscode, 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 | +gitlab_username = node['gitlab']['user']['username'] | ||
| 19 | + | ||
| 20 | +group gitlab_username | ||
| 21 | + | ||
| 22 | +# Create a user for Chef services to run as | ||
| 23 | +user gitlab_username do | ||
| 24 | + shell node['gitlab']['user']['shell'] | ||
| 25 | + home node['gitlab']['user']['home'] | ||
| 26 | + gid gitlab_username | ||
| 27 | +end |