Manage the git server xinetd config
authorTom Hughes <tom@compton.nu>
Wed, 2 Oct 2013 20:20:15 +0000 (21:20 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 2 Oct 2013 20:20:15 +0000 (21:20 +0100)
cookbooks/git/metadata.rb
cookbooks/git/recipes/server.rb
cookbooks/git/templates/default/xinetd.erb [new file with mode: 0644]

index 1b30312..63c60c5 100644 (file)
@@ -5,6 +5,7 @@ description       "Installs and configures git"
 long_description  IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
 version           "1.0.0"
 depends           "networking"
+depends           "xinetd"
 depends           "apache"
 
 attribute "git",
index 59ada04..a287c61 100644 (file)
@@ -18,6 +18,7 @@
 #
 
 include_recipe "networking"
+include_recipe "xinetd"
 
 git_directory = node[:git][:directory]
 
@@ -77,3 +78,11 @@ template "/etc/cron.daily/git-backup" do
   group "root"
   mode 0755
 end
+
+template "/etc/xinetd.d/git" do
+  source "xinetd.erb"
+  owner "root"
+  group "root"
+  mode 0644
+  notifies :reload, resources(:service => "xinetd")
+end
diff --git a/cookbooks/git/templates/default/xinetd.erb b/cookbooks/git/templates/default/xinetd.erb
new file mode 100644 (file)
index 0000000..403c792
--- /dev/null
@@ -0,0 +1,13 @@
+# DO NOT EDIT - This file is being maintained by Chef
+
+service git
+{
+       disable         = no
+       socket_type     = stream
+       wait            = no
+       user            = nobody
+       server          = /usr/lib/git-core/git-daemon
+       server_args     = --base-path=<%= node[:git][:directory] %> --export-all --syslog --inetd --verbose
+       log_on_failure  += USERID
+       flags           = ipv6
+}