Skip to content

Commit

Permalink
Merge pull request #1401 from sathieu/proxy_html24
Browse files Browse the repository at this point in the history
Load mod_xml2enc on Apache >= 2.4 on Debian
  • Loading branch information
hunner committed Apr 14, 2016
2 parents c55a04c + b992643 commit 86ca018
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions manifests/mod/proxy_html.pp
Expand Up @@ -19,6 +19,9 @@
'10' => ['/usr/lib/libxml2.so.2'],
default => ["/usr/lib/${gnu_path}-linux-gnu/libxml2.so.2"],
}
if versioncmp($::apache::apache_version, '2.4') >= 0 {
::apache::mod { 'xml2enc': }
}
}
}

Expand Down
23 changes: 23 additions & 0 deletions spec/classes/mod/proxy_html_spec.rb
Expand Up @@ -32,9 +32,29 @@
context "on squeeze" do
let(:facts) { super().merge({ :operatingsystemrelease => '6' }) }
it_behaves_like "debian", ['/usr/lib/libxml2.so.2']
it { is_expected.to_not contain_apache__mod('xml2enc') }
end
context "on wheezy" do
let(:facts) { super().merge({ :operatingsystemrelease => '7' }) }
it { is_expected.to_not contain_apache__mod('xml2enc') }
context "i386" do
let(:facts) { super().merge({
:hardwaremodel => 'i686',
:architecture => 'i386'
})}
it_behaves_like "debian", ["/usr/lib/i386-linux-gnu/libxml2.so.2"]
end
context "x64" do
let(:facts) { super().merge({
:hardwaremodel => 'x86_64',
:architecture => 'amd64'
})}
it_behaves_like "debian", ["/usr/lib/x86_64-linux-gnu/libxml2.so.2"]
end
end
context "on jessie" do
let(:facts) { super().merge({ :operatingsystemrelease => '8' }) }
it { is_expected.to contain_apache__mod('xml2enc').with(:loadfiles => nil) }
context "i386" do
let(:facts) { super().merge({
:hardwaremodel => 'i686',
Expand Down Expand Up @@ -67,6 +87,7 @@
it { is_expected.to contain_class("apache::params") }
it { is_expected.to contain_apache__mod('proxy_html').with(:loadfiles => nil) }
it { is_expected.to contain_package("mod_proxy_html") }
it { is_expected.to contain_apache__mod('xml2enc').with(:loadfiles => nil) }
end
context "on a FreeBSD OS", :compile do
let :facts do
Expand All @@ -83,6 +104,7 @@
end
it { is_expected.to contain_class("apache::params") }
it { is_expected.to contain_apache__mod('proxy_html').with(:loadfiles => nil) }
it { is_expected.to contain_apache__mod('xml2enc').with(:loadfiles => nil) }
it { is_expected.to contain_package("www/mod_proxy_html") }
end
context "on a Gentoo OS", :compile do
Expand All @@ -100,6 +122,7 @@
end
it { is_expected.to contain_class("apache::params") }
it { is_expected.to contain_apache__mod('proxy_html').with(:loadfiles => nil) }
it { is_expected.to contain_apache__mod('xml2enc').with(:loadfiles => nil) }
it { is_expected.to contain_package("www-apache/mod_proxy_html") }
end
end

0 comments on commit 86ca018

Please sign in to comment.