Commit cdb91575971af5c1ed3188a2bbbaa12ef7958065
1 parent
321360f5
Exists in
master
and in
17 other branches
Create directories and files as the git group
Showing
2 changed files
with
6 additions
and
0 deletions
Show diff stats
files/gitlab-cookbooks/gitlab/attributes/default.rb
| @@ -22,6 +22,7 @@ default['gitlab']['bootstrap']['enable'] = true | @@ -22,6 +22,7 @@ default['gitlab']['bootstrap']['enable'] = true | ||
| 22 | #### | 22 | #### |
| 23 | # The username for the chef services user | 23 | # The username for the chef services user |
| 24 | default['gitlab']['user']['username'] = "git" | 24 | default['gitlab']['user']['username'] = "git" |
| 25 | +default['gitlab']['user']['group'] = "git" | ||
| 25 | # The shell for the chef services user | 26 | # The shell for the chef services user |
| 26 | default['gitlab']['user']['shell'] = "/bin/sh" | 27 | default['gitlab']['user']['shell'] = "/bin/sh" |
| 27 | # The home directory for the chef services user | 28 | # The home directory for the chef services user |
files/gitlab-cookbooks/gitlab/recipes/gitlab-shell.rb
| 1 | git_user = node['gitlab']['user']['username'] | 1 | git_user = node['gitlab']['user']['username'] |
| 2 | +git_group = node['gitlab']['user']['group'] | ||
| 2 | gitlab_shell_dir = "/opt/gitlab/embedded/service/gitlab-shell" | 3 | gitlab_shell_dir = "/opt/gitlab/embedded/service/gitlab-shell" |
| 3 | repositories_path = node['gitlab']['gitlab-core']['repositories_path'] | 4 | repositories_path = node['gitlab']['gitlab-core']['repositories_path'] |
| 4 | ssh_dir = File.join(node['gitlab']['user']['home'], ".ssh") | 5 | ssh_dir = File.join(node['gitlab']['user']['home'], ".ssh") |
| @@ -6,16 +7,19 @@ ssh_dir = File.join(node['gitlab']['user']['home'], ".ssh") | @@ -6,16 +7,19 @@ ssh_dir = File.join(node['gitlab']['user']['home'], ".ssh") | ||
| 6 | # Create directories because the git_user does not own its home directory | 7 | # Create directories because the git_user does not own its home directory |
| 7 | directory repositories_path do | 8 | directory repositories_path do |
| 8 | owner git_user | 9 | owner git_user |
| 10 | + group git_group | ||
| 9 | end | 11 | end |
| 10 | 12 | ||
| 11 | directory ssh_dir do | 13 | directory ssh_dir do |
| 12 | owner git_user | 14 | owner git_user |
| 15 | + group git_group | ||
| 13 | mode "0700" | 16 | mode "0700" |
| 14 | end | 17 | end |
| 15 | 18 | ||
| 16 | template File.join(gitlab_shell_dir, "config.yml") do | 19 | template File.join(gitlab_shell_dir, "config.yml") do |
| 17 | source "gitlab-shell-config.yml.erb" | 20 | source "gitlab-shell-config.yml.erb" |
| 18 | owner git_user | 21 | owner git_user |
| 22 | + group git_group | ||
| 19 | variables( | 23 | variables( |
| 20 | :user => git_user, | 24 | :user => git_user, |
| 21 | :api_url => node['gitlab']['gitlab-core']['internal_api_url'], | 25 | :api_url => node['gitlab']['gitlab-core']['internal_api_url'], |
| @@ -30,5 +34,6 @@ end | @@ -30,5 +34,6 @@ end | ||
| 30 | execute "bin/install" do | 34 | execute "bin/install" do |
| 31 | cwd gitlab_shell_dir | 35 | cwd gitlab_shell_dir |
| 32 | user git_user | 36 | user git_user |
| 37 | + group git_group | ||
| 33 | action :nothing | 38 | action :nothing |
| 34 | end | 39 | end |