From e37fbb62e5a4f2851bf304344117983d9d251c96 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 2 Oct 2013 21:20:15 +0100 Subject: [PATCH] Manage the git server xinetd config --- cookbooks/git/metadata.rb | 1 + cookbooks/git/recipes/server.rb | 9 +++++++++ cookbooks/git/templates/default/xinetd.erb | 13 +++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 cookbooks/git/templates/default/xinetd.erb diff --git a/cookbooks/git/metadata.rb b/cookbooks/git/metadata.rb index 1b30312ad..63c60c5a2 100644 --- a/cookbooks/git/metadata.rb +++ b/cookbooks/git/metadata.rb @@ -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", diff --git a/cookbooks/git/recipes/server.rb b/cookbooks/git/recipes/server.rb index 59ada04a8..a287c6199 100644 --- a/cookbooks/git/recipes/server.rb +++ b/cookbooks/git/recipes/server.rb @@ -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 index 000000000..403c7926b --- /dev/null +++ b/cookbooks/git/templates/default/xinetd.erb @@ -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 +} -- 2.39.5