Skip to content

Commit db8a4f8

Browse files
committed
Merge pull request #819 from smerrill/feature/allow-different-apache-package
Allow overriding the detected $apache_name.
2 parents 445fdc7 + e15c1b7 commit db8a4f8

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,10 @@ Controls how TRACE requests per RFC 2616 are handled. More information about [Tr
425425

426426
Changes the location of the configuration directory your virtual host configuration files are placed in. Defaults to 'etc/httpd/conf.d' on RedHat, '/etc/apache2/sites-available' on Debian, and '/usr/local/etc/apache22/Vhosts' on FreeBSD.
427427

428+
#####`apache_name`
429+
430+
The name of the Apache package to install. This is automatically detected in `::apache::params`. You may need to override this if you are using a non-standard Apache package, such as those from Red Hat's software collections.
431+
428432
####Class: `apache::default_mods`
429433

430434
Installs default Apache modules based on what OS you are running.

manifests/init.pp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# Sample Usage:
1414
#
1515
class apache (
16+
$apache_name = $::apache::params::apache_name,
1617
$service_name = $::apache::params::service_name,
1718
$default_mods = true,
1819
$default_vhost = true,
@@ -83,7 +84,7 @@
8384
if $::osfamily != 'FreeBSD' {
8485
package { 'httpd':
8586
ensure => $package_ensure,
86-
name => $::apache::params::apache_name,
87+
name => $apache_name,
8788
notify => Class['Apache::Service'],
8889
}
8990
}

spec/classes/apache_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,18 @@
541541
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
542542
}
543543
end
544+
context 'with a custom apache_name parameter' do
545+
let :params do {
546+
:apache_name => 'httpd24-httpd'
547+
}
548+
end
549+
it { is_expected.to contain_package("httpd").with(
550+
'notify' => 'Class[Apache::Service]',
551+
'ensure' => 'installed',
552+
'name' => 'httpd24-httpd'
553+
)
554+
}
555+
end
544556
context 'default vhost defaults' do
545557
it { is_expected.to contain_apache__vhost('default').with_ensure('present') }
546558
it { is_expected.to contain_apache__vhost('default-ssl').with_ensure('absent') }

0 commit comments

Comments
 (0)