Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FileETag #1581

Merged
merged 1 commit into from
Dec 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
$server_signature = 'On',
$trace_enable = 'On',
$allow_encoded_slashes = undef,
$file_e_tag = undef,
$package_ensure = 'installed',
$use_optional_includes = $::apache::params::use_optional_includes,
$use_systemd = $::apache::params::use_systemd,
Expand Down
16 changes: 16 additions & 0 deletions spec/acceptance/apache_parameters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,22 @@ class { 'apache':
end
end

describe 'file_e_tag' do
it 'applys cleanly' do
pp = <<-EOS
class { 'apache':
file_e_tag => 'None',
}
EOS
apply_manifest(pp, :catch_failures => true)
end

describe file($conf_file) do
it { is_expected.to be_file }
it { is_expected.to contain 'FileETag None' }
end
end

describe 'package_ensure' do
it 'applys cleanly' do
pp = <<-EOS
Expand Down
8 changes: 8 additions & 0 deletions spec/classes/apache_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@
it { is_expected.to contain_file("/etc/apache2/apache2.conf").with_content %r{^AllowEncodedSlashes nodecode$} }
end

context "when specifying fileETag behaviour" do
let :params do
{ :file_e_tag => 'None' }
end

it { is_expected.to contain_file("/etc/apache2/apache2.conf").with_content %r{^FileETag None$} }
end

context "when specifying default character set" do
let :params do
{ :default_charset => 'none' }
Expand Down
3 changes: 3 additions & 0 deletions templates/httpd.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ EnableSendfile <%= @sendfile %>
<%- if @allow_encoded_slashes -%>
AllowEncodedSlashes <%= @allow_encoded_slashes %>
<%- end -%>
<%- if @file_e_tag -%>
FileETag <%= @file_e_tag %>
<%- end -%>

#Listen 80

Expand Down