Skip to content

Commit

Permalink
Automatically include mod_expires if required via vhost directories
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ekohl committed Aug 22, 2024
1 parent 6d218cf commit d51909d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions manifests/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions spec/defines/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@
}
}
},
{
'path' => '/expires',
'expires_active' => true,
},
],
'error_log' => false,
'error_log_file' => 'httpd_error_log',
Expand Down Expand Up @@ -593,6 +597,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') }
Expand Down

0 comments on commit d51909d

Please sign in to comment.