Skip to content

Commit

Permalink
Merge pull request #819 from smerrill/feature/allow-different-apache-…
Browse files Browse the repository at this point in the history
…package

Allow overriding the detected $apache_name.
  • Loading branch information
igalic committed Aug 18, 2014
2 parents 445fdc7 + e15c1b7 commit db8a4f8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@ Controls how TRACE requests per RFC 2616 are handled. More information about [Tr

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.

#####`apache_name`

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.

####Class: `apache::default_mods`

Installs default Apache modules based on what OS you are running.
Expand Down
3 changes: 2 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# Sample Usage:
#
class apache (
$apache_name = $::apache::params::apache_name,
$service_name = $::apache::params::service_name,
$default_mods = true,
$default_vhost = true,
Expand Down Expand Up @@ -83,7 +84,7 @@
if $::osfamily != 'FreeBSD' {
package { 'httpd':
ensure => $package_ensure,
name => $::apache::params::apache_name,
name => $apache_name,
notify => Class['Apache::Service'],
}
}
Expand Down
12 changes: 12 additions & 0 deletions spec/classes/apache_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,18 @@
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
context 'with a custom apache_name parameter' do
let :params do {
:apache_name => 'httpd24-httpd'
}
end
it { is_expected.to contain_package("httpd").with(
'notify' => 'Class[Apache::Service]',
'ensure' => 'installed',
'name' => 'httpd24-httpd'
)
}
end
context 'default vhost defaults' do
it { is_expected.to contain_apache__vhost('default').with_ensure('present') }
it { is_expected.to contain_apache__vhost('default-ssl').with_ensure('absent') }
Expand Down

0 comments on commit db8a4f8

Please sign in to comment.