Skip to content

Commit 7bd92bc

Browse files
author
Morgan Haskel
committed
Merge pull request #821 from smerrill/feature/fix-remaining-rhel6-scl-issues
Finish SCL support for RHEL/CentOS 6
2 parents 3183890 + bd890c2 commit 7bd92bc

File tree

6 files changed

+25
-5
lines changed

6 files changed

+25
-5
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@ You may establish a default vhost in this class, the `vhost` class, or both. You
227227

228228
Configures the behavior of the module templates, package names, and default mods by setting the Apache version. Default is determined by the class `apache::version` using the OS family and release. It should not be configured manually without special reason.
229229

230+
#####`conf_dir`
231+
232+
Changes the location of the configuration directory the main configuration file is placed in. Defaults to '/etc/httpd/conf' on RedHat, '/etc/apache2' on Debian, and '/usr/local/etc/apache22' on FreeBSD.
233+
230234
#####`confd_dir`
231235

232236
Changes the location of the configuration directory your custom configuration files are placed in. Defaults to '/etc/httpd/conf' on RedHat, '/etc/apache2' on Debian, and '/usr/local/etc/apache22' on FreeBSD.

manifests/default_mods.pp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
::apache::mod { 'log_config': }
1212
if versioncmp($apache_version, '2.4') >= 0 {
1313
# Lets fork it
14-
::apache::mod { 'systemd': }
14+
# Do not try to load mod_systemd on RHEL/CentOS 6 SCL.
15+
if !($::osfamily == 'redhat' and versioncmp($::operatingsystemrelease, '7.0') == -1) {
16+
::apache::mod { 'systemd': }
17+
}
1518
::apache::mod { 'unixd': }
1619
}
1720
}

manifests/init.pp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
$timeout = '120',
3737
$httpd_dir = $::apache::params::httpd_dir,
3838
$server_root = $::apache::params::server_root,
39+
$conf_dir = $::apache::params::conf_dir,
3940
$confd_dir = $::apache::params::confd_dir,
4041
$vhost_dir = $::apache::params::vhost_dir,
4142
$vhost_enable_dir = $::apache::params::vhost_enable_dir,
@@ -219,7 +220,7 @@
219220
content => template('apache/ports_header.erb')
220221
}
221222

222-
if $::apache::params::conf_dir and $::apache::params::conf_file {
223+
if $::apache::conf_dir and $::apache::params::conf_file {
223224
case $::osfamily {
224225
'debian': {
225226
$docroot = '/var/www'
@@ -276,7 +277,7 @@
276277
# - $server_tokens
277278
# - $server_signature
278279
# - $trace_enable
279-
file { "${::apache::params::conf_dir}/${::apache::params::conf_file}":
280+
file { "${::apache::conf_dir}/${::apache::params::conf_file}":
280281
ensure => file,
281282
content => template($conf_template),
282283
notify => Class['Apache::Service'],

manifests/mod.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
$package_before = $::osfamily ? {
6565
'freebsd' => [
6666
File[$_loadfile_name],
67-
File["${::apache::params::conf_dir}/${::apache::params::conf_file}"]
67+
File["${::apache::conf_dir}/${::apache::params::conf_file}"]
6868
],
6969
default => File[$_loadfile_name],
7070
}

manifests/mod/mime_magic.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class apache::mod::mime_magic (
2-
$magic_file = "${::apache::params::conf_dir}/magic"
2+
$magic_file = "${::apache::conf_dir}/magic"
33
) {
44
apache::mod { 'mime_magic': }
55
# Template uses $magic_file

spec/classes/apache_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,18 @@
310310
it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Include "/etc/httpd/mod\.d/\*\.load"$} }
311311
end
312312

313+
describe "Alternate conf directory" do
314+
let :params do
315+
{ :conf_dir => '/opt/rh/root/etc/httpd/conf' }
316+
end
317+
318+
it { is_expected.to contain_file("/opt/rh/root/etc/httpd/conf/httpd.conf").with(
319+
'ensure' => 'file',
320+
'notify' => 'Class[Apache::Service]',
321+
'require' => 'Package[httpd]'
322+
) }
323+
end
324+
313325
describe "Alternate conf.d directory" do
314326
let :params do
315327
{ :confd_dir => '/etc/httpd/special_conf.d' }

0 commit comments

Comments
 (0)