Puppet Class: apache::mod::mime

Inherits:
apache::params
Defined in:
manifests/mod/mime.pp

Summary

Installs and configures `mod_mime`.

Overview

Parameters:

  • mime_support_package (Optional[String]) (defaults to: $apache::params::mime_support_package)

    Name of the MIME package to be installed.

  • mime_types_config (String) (defaults to: $apache::params::mime_types_config)

    The location of the mime.types file.

  • mime_types_additional (Optional[Hash]) (defaults to: undef)

    List of additional MIME types to include.

See Also:



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'manifests/mod/mime.pp', line 15

class apache::mod::mime (
  Optional[String] $mime_support_package = $apache::params::mime_support_package,
  String $mime_types_config              = $apache::params::mime_types_config,
  Optional[Hash] $mime_types_additional  = undef,
) inherits apache::params {
  include apache
  $_mime_types_additional = pick($mime_types_additional, $apache::mime_types_additional)
  apache::mod { 'mime': }
  # Template uses $_mime_types_config
  $parameters = {
    'mime_types_config'      => $mime_types_config,
    '_mime_types_additional' => $_mime_types_additional,
  }

  file { 'mime.conf':
    ensure  => file,
    path    => "${apache::mod_dir}/mime.conf",
    mode    => $apache::file_mode,
    content => epp('apache/mod/mime.conf.epp', $parameters),
    require => Exec["mkdir ${apache::mod_dir}"],
    before  => File[$apache::mod_dir],
    notify  => Class['apache::service'],
  }
  if $mime_support_package {
    package { $mime_support_package:
      ensure => 'installed',
      before => File['mime.conf'],
    }
  }
}