Skip to content

Commit

Permalink
Merge pull request #447 from ptomulik/mod_mime_params
Browse files Browse the repository at this point in the history
Add new params to apache::mod::mime class
  • Loading branch information
Ashley Penney committed Nov 8, 2013
2 parents 092f927 + 803a04d commit 258ad06
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
13 changes: 11 additions & 2 deletions manifests/mod/mime.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
class apache::mod::mime {
class apache::mod::mime (
$mime_support_package = $apache::params::mime_support_package,
$mime_types_config = $apache::params::mime_types_config,
) {
apache::mod { 'mime': }
# Template uses no variables
# Template uses $mime_types_config
file { 'mime.conf':
ensure => file,
path => "${apache::mod_dir}/mime.conf",
Expand All @@ -9,4 +12,10 @@
before => File[$apache::mod_dir],
notify => Service['httpd'],
}
if $mime_support_package {
package { $mime_support_package:
ensure => 'installed',
before => File["${apache::mod_dir}/mime.conf"],
}
}
}
4 changes: 4 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@
$keepalive = 'Off'
$keepalive_timeout = 15
$fastcgi_lib_path = undef
$mime_support_package = 'mailcap'
$mime_types_config = '/etc/mime.types'
} elsif $::osfamily == 'Debian' {
$user = 'www-data'
$group = 'www-data'
Expand Down Expand Up @@ -138,6 +140,8 @@
$keepalive = 'Off'
$keepalive_timeout = 15
$fastcgi_lib_path = '/var/lib/apache2/fastcgi'
$mime_support_package = 'mime-support'
$mime_types_config = '/etc/mime.types'
} else {
fail("Class['apache::params']: Unsupported osfamily: ${::osfamily}")
}
Expand Down
2 changes: 1 addition & 1 deletion templates/mod/mime.conf.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TypesConfig /etc/mime.types
TypesConfig <%= @mime_types_config %>

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
Expand Down

0 comments on commit 258ad06

Please sign in to comment.