Skip to content

Commit

Permalink
Don't include the NameVirtualHost directives in apache >= 2.4, and ad…
Browse files Browse the repository at this point in the history
…d tests for this that will at least work with Ubuntu 13.10 and Ubuntu 14.04.

Tests will still work anywhere with apache < 2.4, but haven't been updated to support RHEL7 yet.
  • Loading branch information
Morgan Haskel committed Apr 25, 2014
1 parent 4cf7709 commit 373a8a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
}
}
if ! $ip_based {
if ! defined(Apache::Namevirtualhost[$nvh_addr_port]) and $ensure == 'present' {
if ! defined(Apache::Namevirtualhost[$nvh_addr_port]) and $ensure == 'present' and $apache_version < 2.4 {
::apache::namevirtualhost { $nvh_addr_port: }
}
}
Expand Down
10 changes: 10 additions & 0 deletions spec/acceptance/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,16 @@ class { 'apache': }
apply_manifest(pp, :catch_failures => true)
end

describe file($ports_file) do
it { should be_file }
case fact('lsbdistcodename')
when 'saucy', 'trusty'
it { should_not contain 'NameVirtualHost test.server' }
else
it { should contain 'NameVirtualHost test.server' }
end
end

describe file("#{$vhost_dir}/10-test.server.conf") do
it { should be_file }
end
Expand Down

0 comments on commit 373a8a9

Please sign in to comment.