-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1189 from traylenator/melon
(MODULES-2458) Support for mod_auth_mellon.
- Loading branch information
Showing
6 changed files
with
260 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class apache::mod::auth_mellon ( | ||
$mellon_cache_size = $::apache::params::mellon_cache_size, | ||
$mellon_lock_file = $::apache::params::mellon_lock_file, | ||
$mellon_post_directory = $::apache::params::mellon_post_directory, | ||
$mellon_cache_entry_size = undef, | ||
$mellon_post_ttl = undef, | ||
$mellon_post_size = undef, | ||
$mellon_post_count = undef | ||
) { | ||
|
||
::apache::mod { 'auth_mellon': } | ||
|
||
# Template uses | ||
# - All variables beginning with mellon_ | ||
file { 'auth_mellon.conf': | ||
ensure => file, | ||
path => "${::apache::mod_dir}/auth_mellon.conf", | ||
content => template('apache/mod/auth_mellon.conf.erb'), | ||
require => [ Exec["mkdir ${::apache::mod_dir}"], ], | ||
before => File[$::apache::mod_dir], | ||
notify => Class['Apache::Service'], | ||
} | ||
|
||
} |
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,87 @@ | ||
describe 'apache::mod::auth_mellon', :type => :class do | ||
let :pre_condition do | ||
'include apache' | ||
end | ||
context "on a Debian OS" do | ||
let :facts do | ||
{ | ||
:osfamily => 'Debian', | ||
:operatingsystemrelease => '6', | ||
:concat_basedir => '/dne', | ||
:lsbdistcodename => 'squeeze', | ||
:operatingsystem => 'Debian', | ||
:id => 'root', | ||
:kernel => 'Linux', | ||
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', | ||
:fqdn => 'test.example.com', | ||
:is_pe => false, | ||
} | ||
end | ||
describe 'with no parameters' do | ||
it { should contain_apache__mod('auth_mellon') } | ||
it { should contain_package('libapache2-mod-auth-mellon') } | ||
it { should contain_file('auth_mellon.conf').with_path('/etc/apache2/mods-available/auth_mellon.conf') } | ||
it { should contain_file('auth_mellon.conf').with_content("MellonPostDirectory \"\/var\/cache\/apache2\/mod_auth_mellon\/\"\n") } | ||
end | ||
describe 'with parameters' do | ||
let :params do | ||
{ :mellon_cache_size => '200', | ||
:mellon_cache_entry_size => '2010', | ||
:mellon_lock_file => '/tmp/junk', | ||
:mellon_post_directory => '/tmp/post', | ||
:mellon_post_ttl => '5', | ||
:mellon_post_size => '8', | ||
:mellon_post_count => '10' | ||
} | ||
end | ||
it { should contain_file('auth_mellon.conf').with_content(/^MellonCacheSize\s+200$/) } | ||
it { should contain_file('auth_mellon.conf').with_content(/^MellonCacheEntrySize\s+2010$/) } | ||
it { should contain_file('auth_mellon.conf').with_content(/^MellonLockFile\s+"\/tmp\/junk"$/) } | ||
it { should contain_file('auth_mellon.conf').with_content(/^MellonPostDirectory\s+"\/tmp\/post"$/) } | ||
it { should contain_file('auth_mellon.conf').with_content(/^MellonPostTTL\s+5$/) } | ||
it { should contain_file('auth_mellon.conf').with_content(/^MellonPostSize\s+8$/) } | ||
it { should contain_file('auth_mellon.conf').with_content(/^MellonPostCount\s+10$/) } | ||
end | ||
|
||
end | ||
context "on a RedHat OS" do | ||
let :facts do | ||
{ | ||
:osfamily => 'RedHat', | ||
:operatingsystemrelease => '6', | ||
:concat_basedir => '/dne', | ||
:operatingsystem => 'RedHat', | ||
:id => 'root', | ||
:kernel => 'Linux', | ||
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', | ||
:fqdn => 'test.example.com', | ||
:is_pe => false, | ||
} | ||
end | ||
describe 'with no parameters' do | ||
it { should contain_apache__mod('auth_mellon') } | ||
it { should contain_package('mod_auth_mellon') } | ||
it { should contain_file('auth_mellon.conf').with_path('/etc/httpd/conf.d/auth_mellon.conf') } | ||
it { should contain_file('auth_mellon.conf').with_content("MellonCacheSize 100\nMellonLockFile \"/run/mod_auth_mellon/lock\"\n") } | ||
end | ||
describe 'with parameters' do | ||
let :params do | ||
{ :mellon_cache_size => '200', | ||
:mellon_cache_entry_size => '2010', | ||
:mellon_lock_file => '/tmp/junk', | ||
:mellon_post_directory => '/tmp/post', | ||
:mellon_post_ttl => '5', | ||
:mellon_post_size => '8', | ||
:mellon_post_count => '10' | ||
} | ||
end | ||
it { should contain_file('auth_mellon.conf').with_content(/^MellonCacheSize\s+200$/) } | ||
it { should contain_file('auth_mellon.conf').with_content(/^MellonCacheEntrySize\s+2010$/) } | ||
it { should contain_file('auth_mellon.conf').with_content(/^MellonLockFile\s+"\/tmp\/junk"$/) } | ||
it { should contain_file('auth_mellon.conf').with_content(/^MellonPostDirectory\s+"\/tmp\/post"$/) } | ||
it { should contain_file('auth_mellon.conf').with_content(/^MellonPostTTL\s+5$/) } | ||
it { should contain_file('auth_mellon.conf').with_content(/^MellonPostSize\s+8$/) } | ||
it { should contain_file('auth_mellon.conf').with_content(/^MellonPostCount\s+10$/) } | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<%- if @mellon_cache_size -%> | ||
MellonCacheSize <%= @mellon_cache_size %> | ||
<%- end -%> | ||
<%- if @mellon_cache_entry_size -%> | ||
MellonCacheEntrySize <%= @mellon_cache_entry_size %> | ||
<%- end -%> | ||
<%- if @mellon_lock_file -%> | ||
MellonLockFile "<%= @mellon_lock_file %>" | ||
<%- end -%> | ||
<%- if @mellon_post_directory -%> | ||
MellonPostDirectory "<%= @mellon_post_directory %>" | ||
<%- end -%> | ||
<%- if @mellon_post_ttl -%> | ||
MellonPostTTL <%= @mellon_post_ttl %> | ||
<%- end -%> | ||
<%- if @mellon_post_size -%> | ||
MellonPostSize <%= @mellon_post_size %> | ||
<%- end -%> | ||
<%- if @mellon_post_count -%> | ||
MellonPostCount <%= @mellon_post_count %> | ||
<%- 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