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

Fixes #35870 - Ensure mod_expires is loaded #1101

Merged
merged 1 commit into from
Jan 12, 2023
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
6 changes: 5 additions & 1 deletion manifests/config/apache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,12 @@
if $suburi {
$custom_fragment = undef
} else {
# mod_env is required by configuration in _assets.conf.erb
# mod_env and mod_expires are required by configuration in _assets.conf.erb
include apache::mod::env
# apache::mod::expires pulls in a config file we don't want, like apache::default_mods
# It uses ensure_resource to be compatible with both $apache::default_mods set to true and false
include apache
ensure_resource('apache::mod', 'expires')
$custom_fragment = file('foreman/_assets.conf.erb')
}

Expand Down
22 changes: 22 additions & 0 deletions spec/classes/foreman_config_apache_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
it { should compile.with_all_deps }

it 'should include apache with modules' do
should contain_class('apache::mod::env')
should contain_apache__mod('expires')
should contain_class('apache::mod::proxy')
should contain_class('apache::mod::proxy_http')
should contain_class('apache::mod::proxy_wstunnel')
Expand Down Expand Up @@ -79,6 +81,26 @@
should_not contain_apache__vhost('foreman-ssl')
end

describe 'with $apache::default_mods set to false' do
let(:pre_condition) do
<<~PUPPET
class { 'apache':
default_mods => false,
}
PUPPET
end

it { should compile.with_all_deps }
it 'includes apache modules' do
should contain_class('apache::mod::env')
should contain_apache__mod('expires')
should contain_class('apache::mod::proxy')
should contain_class('apache::mod::proxy_http')
should contain_class('apache::mod::proxy_wstunnel')
should contain_class('apache::mod::rewrite')
end
end

describe 'with keycloak' do
let(:params) { super().merge(keycloak: true) }

Expand Down