-
-
Notifications
You must be signed in to change notification settings - Fork 875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mime.types file template and default values for it #1243
Conversation
manifests/init.pp
Outdated
@@ -147,6 +147,7 @@ | |||
$package_source = 'nginx', | |||
$package_flavor = undef, | |||
$manage_repo = $nginx::params::manage_repo, | |||
$mime_types = $nginx::params::mime_types, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a datatype for the new parameter. Probably Hash[String[1], String[1]]
templates/conf.d/mime.types.erb
Outdated
<% @mime_types.each do |key, value| -%> | ||
<%= key %> <%= value %>; | ||
<% end -%> | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a trailing newline
templates/conf.d/mime.types.erb
Outdated
@@ -0,0 +1,6 @@ | |||
# MANAGED BY PUPPET |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please convert this to an epp template.
@bastelfreak Hi, I'll take care of it |
- The mine.types file can now be configured using a simple hash
I addressed the issues, but the Beaker tests blew up O_o |
templates/conf.d/mime.types.epp
Outdated
types { | ||
<% $nginx::mime_types.each |$key, $value| { -%> | ||
<%= $key %> <%= $value %>; | ||
<% } -%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the -
I guess.
templates/conf.d/mime.types.epp
Outdated
<% $nginx::mime_types.each |$key, $value| { -%> | ||
<%= $key %> <%= $value %>; | ||
<% } -%> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not an empty newline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To solve a bit of the confusion I might have created. A quote from our review docs:
- Files should always terminate with a newline if possible, with an exception being file or template fragments like those used with concat. This is the POSIX
standard, and some tools don't handle the lack of a terminating newline properly
@bastelfreak Ok, thanks. I'm not too familiar with EPP Templates yet. |
@bastelfreak Hi, should be fine now.
|
@@ -147,6 +147,7 @@ | |||
$package_source = 'nginx', | |||
$package_flavor = undef, | |||
$manage_repo = $nginx::params::manage_repo, | |||
Hash[String[1], String[1]] $mime_types = $nginx::params::mime_types, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
datatypes \o/
Thanks! |
Add mime.types file template and default values for it
Add mime.types file template and default values for it
Pull Request (PR) description
When using this module to only configure nginx and then run in a Container, we ran into an issue when we tried to store the config in a different directory. The config directory can be adjusted using the conf_dir parameter, however the module does not provide a mime.types file.
This PR fixes this issue by adding a simple mime.types.erb that can be filled with a hash, and some default values for the file.
This Pull Request (PR) fixes the following issues
Fixes #1240