Skip to content

Commit b354b21

Browse files
committed
Ensure mod::autoindex is added when needed
1 parent b23664e commit b354b21

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

manifests/vhost.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2357,6 +2357,10 @@
23572357
include apache::mod::auth_gssapi
23582358
}
23592359

2360+
if 'index_options' in $directory or 'index_order_default' in $directory or 'index_style_sheet' in $directory {
2361+
include apache::mod::autoindex
2362+
}
2363+
23602364
if $directory['provider'] and $directory['provider'] =~ 'location' and ('proxy_pass' in $directory or 'proxy_pass_match' in $directory) {
23612365
include apache::mod::proxy_http
23622366

spec/defines/vhost_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,6 +2258,23 @@
22582258
it { is_expected.to contain_class('apache::mod::dav') }
22592259
it { is_expected.to contain_class('apache::mod::dav_svn') }
22602260
end
2261+
2262+
context 'mod_autoindex is included when needed' do
2263+
let :params do
2264+
{
2265+
'docroot' => '/var/www/foo',
2266+
'directories' => [
2267+
{
2268+
'index_options' => ['FancyIndexing'],
2269+
},
2270+
]
2271+
2272+
}
2273+
end
2274+
2275+
it { is_expected.to compile }
2276+
it { is_expected.to contain_class('apache::mod::autoindex') }
2277+
end
22612278
end
22622279
end
22632280
end

0 commit comments

Comments
 (0)