From 6e42fb28f2dfbc12490faca3a250bc2c9280c90f Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Sat, 17 Aug 2024 01:54:19 +0200 Subject: [PATCH] Automatically include mod_expires if required via vhost directories Similar to other options passed in the vhost's directory this now inspects the directories entry and if expires_* is passed, mod_expires is included. --- manifests/vhost.pp | 4 ++++ spec/defines/vhost_spec.rb | 1 + 2 files changed, 5 insertions(+) diff --git a/manifests/vhost.pp b/manifests/vhost.pp index 7414a6f16..8273469f7 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -2362,6 +2362,10 @@ if 'setenv' in $directory { include apache::mod::env } + + if 'expires_active' in $directory or 'expires_default' in $directory or 'expires_by_type' in $directory { + include apache::mod::expires + } } # Template uses: diff --git a/spec/defines/vhost_spec.rb b/spec/defines/vhost_spec.rb index f448b8ca5..02ebc111e 100644 --- a/spec/defines/vhost_spec.rb +++ b/spec/defines/vhost_spec.rb @@ -593,6 +593,7 @@ it { is_expected.to contain_class('apache::mod::authz_groupfile') } it { is_expected.to contain_class('apache::mod::auth_gssapi') } it { is_expected.to contain_class('apache::mod::env') } + it { is_expected.to contain_class('apache::mod::expires') } it { is_expected.to contain_class('apache::mod::filter') } it { is_expected.to contain_class('apache::mod::headers') } it { is_expected.to contain_class('apache::mod::mime') }