This repository has been archived by the owner on Nov 23, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 678
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
177 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# | ||
# Cookbook Name:: subversion | ||
# Attributes:: server | ||
# | ||
# Copyright 2009, Daniel DeLeo | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
subversion Mash.new unless attribute?("subversion") | ||
default.subversion.repo_dir "/srv/svn" | ||
default.subversion.repo_name "repo" | ||
default.subversion.server_name "svn" # hostname of apache virtual host | ||
default.subversion.user "subversion" | ||
default.subversion.password "subversion" # please override this :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,50 @@ | ||
{ | ||
"recommendations": { | ||
}, | ||
"attributes": { | ||
}, | ||
"maintainer": "Opscode, Inc.", | ||
"suggestions": { | ||
}, | ||
"dependencies": { | ||
}, | ||
"maintainer_email": "cookbooks@opscode.com", | ||
"conflicting": { | ||
}, | ||
"platforms": { | ||
"debian": [ | ||
"name": "subversion", | ||
"description": "Installs subversion", | ||
"long_description": "", | ||
"maintainer": "Opscode, Inc.", | ||
"maintainer_email": "cookbooks@opscode.com", | ||
"license": "Apache 2.0", | ||
"platforms": { | ||
"redhat": [ | ||
|
||
], | ||
"fedora": [ | ||
], | ||
"centos": [ | ||
|
||
], | ||
"centos": [ | ||
], | ||
"fedora": [ | ||
|
||
], | ||
"ubuntu": [ | ||
], | ||
"ubuntu": [ | ||
|
||
], | ||
"redhat": [ | ||
], | ||
"debian": [ | ||
|
||
] | ||
}, | ||
"license": "Apache 2.0", | ||
"version": "0.8.1", | ||
"providing": { | ||
}, | ||
"recipes": { | ||
"subversion": "Installs subversion and extra svn packages" | ||
}, | ||
"replacing": { | ||
}, | ||
"name": "subversion", | ||
"description": "Installs subversion", | ||
"groupings": { | ||
}, | ||
"long_description": "" | ||
} | ||
] | ||
}, | ||
"dependencies": { | ||
"apache2": [ | ||
|
||
] | ||
}, | ||
"recommendations": { | ||
}, | ||
"suggestions": { | ||
}, | ||
"conflicting": { | ||
}, | ||
"providing": { | ||
}, | ||
"replacing": { | ||
}, | ||
"attributes": { | ||
}, | ||
"groupings": { | ||
}, | ||
"recipes": { | ||
"subversion": "Includes the client recipe.", | ||
"subversion::client": "Subversion Client installs subversion and some extra svn libs", | ||
"subversion::server": "Subversion Server (Apache2 mod_dav_svn)" | ||
}, | ||
"version": "0.8.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# Cookbook Name:: subversion | ||
# Recipe:: default | ||
# | ||
# Copyright 2008, OpsCode, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0c | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
package "subversion" do | ||
action :install | ||
end | ||
|
||
extra_packages = case node[:platform] | ||
when "ubuntu","debian" | ||
if node[:platform_version].to_f < 8.04 | ||
%w{subversion-tools libsvn-core-perl} | ||
else | ||
%w{subversion-tools libsvn-perl} | ||
end | ||
when "centos","redhat","fedora" | ||
%w{subversion-devel subversion-perl} | ||
end | ||
|
||
extra_packages.each do |pkg| | ||
package pkg do | ||
action :install | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# | ||
# Author:: Daniel DeLeo <dan@kallistec.com> | ||
# Cookbook Name:: subversion | ||
# Recipe:: server | ||
# | ||
# Copyright 2009, Daniel DeLeo | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
include_recipe "apache2::mod_dav_svn" | ||
include_recipe "subversion::client" | ||
|
||
directory node[:subversion][:repo_dir] do | ||
recursive true | ||
owner node[:apache][:user] | ||
group node[:apache][:user] | ||
mode "0755" | ||
end | ||
|
||
web_app "subversion" do | ||
template "subversion.conf.erb" | ||
server_name "#{node[:subversion][:server_name]}.#{node[:domain]}" | ||
notifies :restart, resources(:service => "apache2") | ||
end | ||
|
||
execute "svnadmin create repo" do | ||
command "svnadmin create #{node[:subversion][:repo_dir]}/#{node[:subversion][:repo_name]}" | ||
creates "#{node[:subversion][:repo_dir]}/#{node[:subversion][:repo_name]}" | ||
user node[:apache][:user] | ||
group node[:apache][:user] | ||
end | ||
|
||
execute "create htpasswd file" do | ||
command "htpasswd -scb #{node[:subversion][:repo_dir]}/htpasswd #{node[:subversion][:user]} #{node[:subversion][:password]}" | ||
creates "#{node[:subversion][:repo_name]}/htpasswd" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Location /svn> | ||
|
||
DAV svn | ||
|
||
SVNPath /srv/svn/repo | ||
|
||
AuthType Basic | ||
|
||
AuthName "Subversion repository" | ||
|
||
AuthUserFile /srv/svn/htpasswd | ||
|
||
Require valid-user | ||
|
||
</Location> |