File: mime_magic.pp

package info (click to toggle)
puppet-module-puppetlabs-apache 12.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,664 kB
  • sloc: ruby: 275; sh: 32; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 855 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
# @summary
#   Installs and configures `mod_mime_magic`.
# 
# @param magic_file
#   Enable MIME-type determination based on file contents using the specified magic file.
# 
# @see https://httpd.apache.org/docs/current/mod/mod_mime_magic.html for additional documentation.
#
class apache::mod::mime_magic (
  Optional[String] $magic_file = undef,
) {
  include apache
  $_magic_file = pick($magic_file, "${apache::conf_dir}/magic")
  apache::mod { 'mime_magic': }
  # Template uses $magic_file
  file { 'mime_magic.conf':
    ensure  => file,
    path    => "${apache::mod_dir}/mime_magic.conf",
    mode    => $apache::file_mode,
    content => epp('apache/mod/mime_magic.conf.epp', { '_magic_file' => $_magic_file, }),
    require => Exec["mkdir ${apache::mod_dir}"],
    before  => File[$apache::mod_dir],
    notify  => Class['apache::service'],
  }
}