Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Ensure mod::autoindex is added when needed
  • Loading branch information
gcoxmoz committed Jun 26, 2025
commit b354b215fc75beee0320a4e8f908b4d014c2e8ad
4 changes: 4 additions & 0 deletions manifests/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2357,6 +2357,10 @@
include apache::mod::auth_gssapi
}

if 'index_options' in $directory or 'index_order_default' in $directory or 'index_style_sheet' in $directory {
include apache::mod::autoindex
}

if $directory['provider'] and $directory['provider'] =~ 'location' and ('proxy_pass' in $directory or 'proxy_pass_match' in $directory) {
include apache::mod::proxy_http

Expand Down
17 changes: 17 additions & 0 deletions spec/defines/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2258,6 +2258,23 @@
it { is_expected.to contain_class('apache::mod::dav') }
it { is_expected.to contain_class('apache::mod::dav_svn') }
end

context 'mod_autoindex is included when needed' do
let :params do
{
'docroot' => '/var/www/foo',
'directories' => [
{
'index_options' => ['FancyIndexing'],
},
]

}
end

it { is_expected.to compile }
it { is_expected.to contain_class('apache::mod::autoindex') }
end
end
end
end
Expand Down