Skip to content

Commit

Permalink
Merge pull request #723 from mhaskel/rhel7-fixes
Browse files Browse the repository at this point in the history
Some initial cleanup for RHEL7.
  • Loading branch information
hunner committed May 7, 2014
2 parents c9bc436 + f19ec76 commit 82a6ba0
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 19 deletions.
9 changes: 5 additions & 4 deletions manifests/default_mods.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
case $::osfamily {
'redhat', 'freebsd': {
::apache::mod { 'log_config': }
if $apache_version >= 2.4 {
# Lets fork it
::apache::mod { 'systemd': }
::apache::mod { 'unixd': }
}
}
default: {}
}
Expand Down Expand Up @@ -43,10 +48,6 @@
::apache::mod { 'version': }

if $apache_version >= 2.4 {
# Lets fork it
::apache::mod { 'systemd': }

::apache::mod { 'unixd': }
::apache::mod { 'authn_core': }
}
else {
Expand Down
12 changes: 8 additions & 4 deletions spec/acceptance/apache_parameters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -328,29 +328,33 @@ class { 'apache':
describe 'logging' do
describe 'setup' do
it 'applies cleanly' do
pp = "class { 'apache': logroot => '/tmp' }"
pp = <<-EOS
file { '/apache_spec': ensure => directory, }
class { 'apache': logroot => '/apache_spec' }
EOS
apply_manifest(pp, :catch_failures => true)
end
end

describe file("/tmp/#{$error_log}") do
describe file("/apache_spec/#{$error_log}") do
it { should be_file }
end
end

describe 'ports_file' do
it 'applys cleanly' do
pp = <<-EOS
file { '/apache_spec': ensure => directory, }
class { 'apache':
ports_file => '/tmp/ports_file',
ports_file => '/apache_spec/ports_file',
ip => '10.1.1.1',
service_ensure => stopped
}
EOS
apply_manifest(pp, :catch_failures => true)
end

describe file('/tmp/ports_file') do
describe file('/apache_spec/ports_file') do
it { should be_file }
it { should contain 'Listen 10.1.1.1' }
end
Expand Down
7 changes: 4 additions & 3 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ class { 'apache': }
# Using puppet_apply as a helper
it 'should work with no errors' do
pp = <<-EOS
file { '/tmp/apache_custom': ensure => directory, }
file { '/apache_spec': ensure => directory, }
file { '/apache_spec/apache_custom': ensure => directory, }
class { 'apache':
mod_dir => '/tmp/apache_custom/mods',
vhost_dir => '/tmp/apache_custom/vhosts',
mod_dir => '/apache_spec/apache_custom/mods',
vhost_dir => '/apache_spec/apache_custom/vhosts',
}
EOS

Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/mod_proxy_html_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
end

context "default proxy_html config" do
if fact('osfamily') == 'RedHat'
if fact('osfamily') == 'RedHat' and fact('operatingsystemmajrelease') =~ /(5|6)/
it 'adds epel' do
pp = "class { 'epel': }"
apply_manifest(pp, :catch_failures => true)
Expand Down
16 changes: 9 additions & 7 deletions spec/acceptance/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,9 @@ class { 'apache': }

describe file($ports_file) do
it { should be_file }
case fact('lsbdistcodename')
when 'saucy', 'trusty'
if fact('osfamily') == 'RedHat' and fact('operatingsystemmajrelease') == '7'
it { should_not contain 'NameVirtualHost test.server' }
elsif fact('operatingsystem') == 'Ubuntu' and fact('operatingsystemrelease') =~ /(14\.04|13\.10)/
it { should_not contain 'NameVirtualHost test.server' }
else
it { should contain 'NameVirtualHost test.server' }
Expand Down Expand Up @@ -1012,7 +1013,7 @@ class { 'apache': }
end

# So what does this work on?
if default['platform'] !~ /^(debian-(6|7)|el-(5|6))/
if default['platform'] !~ /^(debian-(6|7)|el-(5|6|7))/
describe 'fastcgi' do
it 'applies cleanly' do
pp = <<-EOS
Expand Down Expand Up @@ -1042,18 +1043,19 @@ class { 'apache::mod::fastcgi': }
pp = <<-EOS
class { 'apache': }
host { 'test.server': ip => '127.0.0.1' }
file { '/tmp/include': ensure => present, content => '#additional_includes' }
file { '/apache_spec': ensure => directory, }
file { '/apache_spec/include': ensure => present, content => '#additional_includes' }
apache::vhost { 'test.server':
docroot => '/tmp',
additional_includes => '/tmp/include',
docroot => '/apache_spec',
additional_includes => '/apache_spec/include',
}
EOS
apply_manifest(pp, :catch_failures => true)
end

describe file("#{$vhost_dir}/25-test.server.conf") do
it { should be_file }
it { should contain 'Include "/tmp/include"' }
it { should contain 'Include "/apache_spec/include"' }
end
end

Expand Down

0 comments on commit 82a6ba0

Please sign in to comment.