Showing with 36 additions and 2 deletions.
  1. +8 −0 CHANGELOG.md
  2. +5 −1 manifests/config/apache.pp
  3. +1 −1 metadata.json
  4. +22 −0 spec/classes/foreman_config_apache_spec.rb
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [22.1.1](https://github.com/theforeman/puppet-foreman/tree/22.1.1) (2023-01-26)

[Full Changelog](https://github.com/theforeman/puppet-foreman/compare/22.1.0...22.1.1)

**Fixed bugs:**

- Fixes [\#35870](https://projects.theforeman.org/issues/35870) - Ensure mod\_expires is loaded [\#1101](https://github.com/theforeman/puppet-foreman/pull/1101) ([ekohl](https://github.com/ekohl))

## [22.1.0](https://github.com/theforeman/puppet-foreman/tree/22.1.0) (2022-12-14)

[Full Changelog](https://github.com/theforeman/puppet-foreman/compare/22.0.0...22.1.0)
Expand Down
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
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "theforeman-foreman",
"version": "22.1.0",
"version": "22.1.1",
"author": "theforeman",
"summary": "Foreman server configuration",
"license": "GPL-3.0+",
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