]> git.openstreetmap.org Git - chef.git/commitdiff
Fix git repository ownership
authorTom Hughes <tom@compton.nu>
Wed, 2 Oct 2013 18:52:35 +0000 (19:52 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 2 Oct 2013 18:52:35 +0000 (19:52 +0100)
cookbooks/git/attributes/default.rb
cookbooks/git/recipes/server.rb
roles/ironbelly.rb

index efeaa6aae31cad8586e3c48fa2edec834052bcbc..ebb2bd736d53bc83f288a6914a9203311ac1109e 100644 (file)
@@ -1 +1,3 @@
 default[:git][:directory] = "/var/lib/git"
+default[:git][:user] = "git"
+default[:git][:group] = "git"
index 4f537e62d0b7958f23608fd7eecddcb90ac40e0e..59ada04a8373ebeaeff86b77b11c1b591675ac91 100644 (file)
@@ -22,8 +22,8 @@ include_recipe "networking"
 git_directory = node[:git][:directory]
 
 directory git_directory do
-  owner "git"
-  group "git"
+  owner node[:git][:user]
+  group node[:git][:group]
   mode 02775
 end
 
@@ -56,7 +56,7 @@ Dir.new(git_directory).select { |name| name =~ /\.git$/ }.each do |repository|
   template "#{git_directory}/#{repository}/hooks/post-update" do
     source "post-update.erb"
     owner "root"
-    group "git"
+    group node[:git][:group]
     mode 0755
   end
 
@@ -64,7 +64,7 @@ Dir.new(git_directory).select { |name| name =~ /\.git$/ }.each do |repository|
     template "#{git_directory}/#{repository}/hooks/post-receive" do
       source "post-receive.erb"
       owner "root"
-      group "git"
+      group node[:git][:group]
       mode 0755
       variables :repository => "#{git_directory}/#{repository}"
     end
index c831c995cc0826fe72c83aa64ea23d69654106ce..7c90c9c87ed9d569e2b87134fd375d83edb74573 100644 (file)
@@ -7,6 +7,8 @@ default_attributes(
   },
   :git => {
     :allowed_nodes => "*:*",
+    :user => "chefrepo",
+    :group => "chefrepo",
     :backup => "chef-git"
   },
   :networking => {