File: autoindex.pp

package info (click to toggle)
puppet-module-puppetlabs-apache 12.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,664 kB
  • sloc: ruby: 275; sh: 32; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 959 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# @summary
#   Installs `mod_autoindex`
# 
# @param icons_prefix
#   Change the alias for /icons/.
# 
# @see https://httpd.apache.org/docs/current/mod/mod_autoindex.html for additional documentation.
#
class apache::mod::autoindex (
  String $icons_prefix = $apache::params::icons_prefix
) inherits apache::params {
  include apache
  ::apache::mod { 'autoindex': }

  # Determine icon filename suffix for autoindex.conf.epp
  case $facts['os']['name'] {
    'Debian', 'Ubuntu': {
      $icon_suffix = '-20x22'
    }
    default: {
      $icon_suffix = ''
    }
  }

  file { 'autoindex.conf':
    ensure  => file,
    path    => "${apache::mod_dir}/autoindex.conf",
    mode    => $apache::file_mode,
    content => epp('apache/mod/autoindex.conf.epp', { 'icons_prefix' => $icons_prefix, 'icon_suffix' => $icon_suffix, }),
    require => Exec["mkdir ${apache::mod_dir}"],
    before  => File[$apache::mod_dir],
    notify  => Class['apache::service'],
  }
}