+ mode "644"
+end
+
+template "/srv/#{git_site}/indextext.html" do
+ source "indextext.html.erb"
+ owner "root"
+ group "root"
+ mode "644"
+end
+
+ssl_certificate git_site do
+ domains [git_site] + Array(node[:git][:aliases])
+ notifies :reload, "service[apache2]"
+end
+
+private_allowed = search(:node, node[:git][:private_nodes]).collect do |n|
+ n.ipaddresses(:role => :external)
+end.flatten
+
+apache_site git_site do
+ template "apache.erb"
+ directory "/srv/#{git_site}"
+ variables :aliases => Array(node[:git][:aliases]),
+ :private_allowed => private_allowed