forked from redhat-openstack/openstack-puppet-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for SVN authentication (mod_authz_svn)
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
Showing
3 changed files
with
69 additions
and
5 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
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,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'], | ||
} | ||
} | ||
} |
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,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 |