Skip to content

Commit 503be6d

Browse files
committed
Allow other manifests to define ::apache::mod{ 'ssl': }.
This will allow Apache from the httpd24 SCL on RHELish systems to include the proper mod_ssl package while still letting ssl ::apache::vhost defines work as expected. Add package_name param to ::apache::mod::ssl. Add a test for the package_name parameter. Update the package_name parameter test.
1 parent 445fdc7 commit 503be6d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

manifests/mod/ssl.pp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
$ssl_options = [ 'StdEnvVars' ],
44
$ssl_cipher = 'HIGH:MEDIUM:!aNULL:!MD5',
55
$apache_version = $::apache::apache_version,
6+
$package_name = undef,
67
) {
78
$session_cache = $::osfamily ? {
89
'debian' => '${APACHE_RUN_DIR}/ssl_scache(512000)',
@@ -31,7 +32,9 @@
3132
}
3233
}
3334

34-
::apache::mod { 'ssl': }
35+
::apache::mod { 'ssl':
36+
package => $package_name,
37+
}
3538

3639
if versioncmp($apache_version, '2.4') >= 0 {
3740
::apache::mod { 'socache_shmcb': }

spec/classes/mod/ssl_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@
3434
it { is_expected.to contain_class('apache::params') }
3535
it { is_expected.to contain_apache__mod('ssl') }
3636
it { is_expected.to contain_package('mod_ssl') }
37+
context 'with a custom package_name parameter' do
38+
let :params do
39+
{ :package_name => 'httpd24-mod_ssl' }
40+
end
41+
it { is_expected.to contain_class('apache::params') }
42+
it { is_expected.to contain_apache__mod('ssl') }
43+
it { is_expected.to contain_package('httpd24-mod_ssl') }
44+
it { is_expected.not_to contain_package('mod_ssl') }
45+
end
3746
end
3847

3948
context 'on a Debian OS' do

0 commit comments

Comments
 (0)