Commit d6e20d8d87161c07acf2e5c304ef3713dfdd114b

Authored by Jacob Vosmaer
2 parents c2949d1d 7428d7df

Merge branch 'git_user' into 'master'

Git User
files/gitlab-cookbooks/gitlab/attributes/default.rb
... ... @@ -17,6 +17,17 @@
17 17  
18 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 32 # PostgreSQL
22 33 ###
... ...
files/gitlab-cookbooks/gitlab/recipes/default.rb
... ... @@ -44,6 +44,8 @@ directory "/var/opt/gitlab" do
44 44 action :create
45 45 end
46 46  
  47 +include_recipe "gitlab::users"
  48 +
47 49 # Install our runit instance
48 50 include_recipe "runit"
49 51  
... ...
files/gitlab-cookbooks/gitlab/recipes/users.rb 0 → 100644
... ... @@ -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
... ...