Skip to content

Commit

Permalink
Add support for SVN authentication (mod_authz_svn)
Browse files Browse the repository at this point in the history
Add dependency for authz_svn. This is needed, since the mod is included in the dav_svn system package. Thanks @hunner for pointing this out!

- Add parameter for controling the enabl-/disabling of the authz_svn module. (Disabled by default)
- Optimize the dependency management

Mark dav_svn module as a module which has optional setings.

Add loadfile_name parameter for better module load order

Add acceptance test for dav_svn module
  • Loading branch information
baurmatt committed May 29, 2014
1 parent f4eb4fa commit d4dbd9b
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ There are many `apache::mod::[name]` classes within this module that can be decl
* `cgid`
* `dav`
* `dav_fs`
* `dav_svn`
* `dav_svn`*
* `deflate`
* `dev`
* `dir`*
Expand Down
17 changes: 13 additions & 4 deletions manifests/mod/dav_svn.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
class apache::mod::dav_svn {
Class['::apache::mod::dav'] -> Class['::apache::mod::dav_svn']
include ::apache::mod::dav
::apache::mod { 'dav_svn': }
class apache::mod::dav_svn (
$authz_svn_enabled = false,
) {
Class['::apache::mod::dav'] -> Class['::apache::mod::dav_svn']
include ::apache::mod::dav
::apache::mod { 'dav_svn': }

if $authz_svn_enabled {
::apache::mod { 'authz_svn':
loadfile_name => 'dav_svn_authz_svn.load',
require => Apache::Mod['dav_svn'],
}
}
}
55 changes: 55 additions & 0 deletions spec/acceptance/mod_dav_svn_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
require 'spec_helper_acceptance'

describe 'apache::mod::dav_svn class' do
case fact('osfamily')
when 'Debian'
mod_dir = '/etc/apache2/mods-available'
service_name = 'apache2'
when 'RedHat'
mod_dir = '/etc/httpd/conf.d'
service_name = 'httpd'
when 'FreeBSD'
mod_dir = '/usr/local/etc/apache22/Modules'
service_name = 'apache22'
end

context "default dav_svn config" do
it 'succeeds in puppeting dav_svn' do
pp= <<-EOS
class { 'apache': }
include apache::mod::dav_svn
EOS
apply_manifest(pp, :catch_failures => true)
end

describe service(service_name) do
it { should be_enabled }
it { should be_running }
end

describe file("#{mod_dir}/dav_svn.load") do
it { should contain "LoadModule dav_svn_module" }
end
end

context "dav_svn with enabled authz_svn config" do
it 'succeeds in puppeting dav_svn' do
pp= <<-EOS
class { 'apache': }
class { 'apache::mod::dav_svn':
authz_svn_enabled => true,
}
EOS
apply_manifest(pp, :catch_failures => true)
end

describe service(service_name) do
it { should be_enabled }
it { should be_running }
end

describe file("#{mod_dir}/authz_svn.load") do
it { should contain "LoadModule authz_svn_module" }
end
end
end

0 comments on commit d4dbd9b

Please sign in to comment.