]> git.openstreetmap.org Git - chef.git/blob - cookbooks/subversion/recipes/default.rb
f9398d8cc06c19ecd0e72a1c94e25b171df05334
[chef.git] / cookbooks / subversion / recipes / default.rb
1 #
2 # Cookbook Name:: subversion
3 # Recipe:: default
4 #
5 # Copyright 2012, OpenStreetMap Foundation
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #     http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19
20 include_recipe "apache"
21
22 package "subversion"
23
24 site_name = "svn.openstreetmap.org"
25 repository_directory = "/var/lib/subversion/repos/openstreetmap"
26
27 remote_directory "#{repository_directory}/hooks" do
28   source "hooks"
29   owner "www-data"
30   group "www-data"
31   mode 0755
32   files_owner "www-data"
33   files_group "www-data"
34   files_mode 0755
35   purge false
36 end
37
38 apache_module "authz_svn" do
39   package "libapache2-svn"
40 end
41
42 apache_module "dav_svn" do
43   package "libapache2-svn"
44 end
45
46 apache_site site_name do
47   template "apache.erb"
48   directory repository_directory
49   variables :realm => "Subversion Repository", :password_file => "/etc/apache2/svn.passwd"
50 end
51
52 template "/etc/cron.daily/svn-backup" do
53   source "backup.cron.erb"
54   owner "root"
55   group "root"
56   mode 0755
57 end