-
-
Notifications
You must be signed in to change notification settings - Fork 883
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 support for dynamic modules. #1180
Conversation
manifests/init.pp
Outdated
@@ -33,6 +33,7 @@ | |||
Optional[Enum['on', 'off']] $daemon = undef, | |||
$daemon_user = $::nginx::params::daemon_user, | |||
$daemon_group = undef, | |||
Optional[Array[String]] $dynamic_module = undef, |
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.
Can you update it so it defaults to an empty array?
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.
I'd also prefer it to be named dynamic_modules
since it's an array.
@@ -337,6 +337,12 @@ | |||
|
|||
describe 'nginx.conf template content' do | |||
[ | |||
{ | |||
title: 'should not set load_module', |
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.
can you add another test that sets a module and checks if it is present in the config file?
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.
This is done, check lines 891-910
templates/conf.d/nginx.conf.erb
Outdated
@@ -1,4 +1,13 @@ | |||
# MANAGED BY PUPPET | |||
<% if @dynamic_module.is_a?(Array) -%> |
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.
the variable is always an array, so you don't need this check
Hi @sevencastles, thanks for the PR! I added a few inline comments, please take a look at them. The used email address in your commit doesn't match the one you've configured in your github settings. Now the commit isn't associated with your account. Can you please fix that? |
Hi, |
Thanks for the updates @sevencastles . Can you take a look at #1180 (comment) ? |
0bc7a54
to
fe6606a
Compare
Hi @bastelfreak. I've squashed the commits into one. Also, I've (already) added the tests you've asked, if I have understood you right. |
templates/conf.d/nginx.conf.erb
Outdated
@@ -1,4 +1,11 @@ | |||
# MANAGED BY PUPPET | |||
<% Array(@dynamic_modules).each do |mod_item| -%> |
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.
Can you get rid of the Array()?
That isn't needed since it's always an array.
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.
I will do. Sorry, I am not very good with ERB
fe6606a
to
3678fed
Compare
Hi, |
3678fed
to
af228c7
Compare
I've updated my pull request to be compatible with the latest master. Can you have a look and merge it? @bastelfreak Thanks |
manifests/init.pp
Outdated
@@ -33,6 +33,7 @@ | |||
Optional[Enum['on', 'off']] $daemon = undef, | |||
$daemon_user = $nginx::params::daemon_user, | |||
$daemon_group = undef, | |||
Optional[Array[String]] $dynamic_modules = [], |
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.
If not defaulting to undef
, do you really need to use Optional
?
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.
I guess I can indeed remove Optional
. Will do
Allow nginx to load dynamic modules by specifying an absolute or a relative ("modules/") path. Modules must be installed separately and before loading the puppet nginx module.
af228c7
to
e7199da
Compare
Add support for dynamic modules.
Allow nginx to load dynamic modules by specifying an absolute or a
relative ("modules/") path. Modules must be installed separately and
before loading the puppet nginx module.