Skip to content

Commit 4d8608c

Browse files
author
kuchosauronad0
committed
Add FileETag
1 parent d1063a6 commit 4d8608c

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

manifests/init.pp

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
$server_signature = 'On',
7777
$trace_enable = 'On',
7878
$allow_encoded_slashes = undef,
79+
$file_e_tag = undef,
7980
$package_ensure = 'installed',
8081
$use_optional_includes = $::apache::params::use_optional_includes,
8182
$use_systemd = $::apache::params::use_systemd,

spec/acceptance/apache_parameters_spec.rb

+16
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,22 @@ class { 'apache':
483483
end
484484
end
485485

486+
describe 'file_e_tag' do
487+
it 'applys cleanly' do
488+
pp = <<-EOS
489+
class { 'apache':
490+
file_e_tag => 'None',
491+
}
492+
EOS
493+
apply_manifest(pp, :catch_failures => true)
494+
end
495+
496+
describe file($conf_file) do
497+
it { is_expected.to be_file }
498+
it { is_expected.to contain 'FileETag None' }
499+
end
500+
end
501+
486502
describe 'package_ensure' do
487503
it 'applys cleanly' do
488504
pp = <<-EOS

spec/classes/apache_spec.rb

+8
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@
110110
it { is_expected.to contain_file("/etc/apache2/apache2.conf").with_content %r{^AllowEncodedSlashes nodecode$} }
111111
end
112112

113+
context "when specifying fileETag behaviour" do
114+
let :params do
115+
{ :file_e_tag => 'None' }
116+
end
117+
118+
it { is_expected.to contain_file("/etc/apache2/apache2.conf").with_content %r{^FileETag None$} }
119+
end
120+
113121
context "when specifying default character set" do
114122
let :params do
115123
{ :default_charset => 'none' }

templates/httpd.conf.erb

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ EnableSendfile <%= @sendfile %>
6161
<%- if @allow_encoded_slashes -%>
6262
AllowEncodedSlashes <%= @allow_encoded_slashes %>
6363
<%- end -%>
64+
<%- if @file_e_tag -%>
65+
FileETag <%= @file_e_tag %>
66+
<%- end -%>
6467

6568
#Listen 80
6669

0 commit comments

Comments
 (0)