-
Notifications
You must be signed in to change notification settings - Fork 304
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 nginx_http_extra_params
variable in default vars
#149
Conversation
Merge changes from original repo
Hello @shrmrf,
By doing that people can use the power of ansible to combine or not parameters by doing something like that: |
Yeah, makes sense. This is what I proposed too but instead of concatenating the two lists to create the parameters, I just added another one. Both are good IMO. (though I can add it to the pull request if you like but I was scared that you will break code of people already abusing the It makes more sense to have the operation Let me know what you think and I can update my pull request. |
There is little misunderstand I think. By implementing just:
We normally have retrocompatibility, we limit the complexity of the project and we have possibility to manage extra params in the playbook easely (for people that need advance usage). |
hmmm.... Okay. I think this is better. So a usage will look like: vars:
- my_extra_params:
- client_max_body_size 200M
# retain defaults and add additional `client_max_body_size` param
- role: jdauphant.nginx
nginx_http_params: {{ nginx_http_params_defaults + my_extra_params }} This is a good solution too. Agreed. Should I update my pull request? |
yes, it's exactly that ! Thanks for your help |
assign default param var to nginx params update readme with example
Hello @jdauphant updated the pull request to the best of my understanding. |
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.
Thanks for the change, I made a few comments
@@ -138,6 +138,19 @@ for details. | |||
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for | |||
``` | |||
|
|||
4) Install nginx and add extra variables to default config |
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.
We have two number "4)"
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.
updated wth the requests!
roles: | ||
- role: jdauphant.nginx | ||
nginx_http_params: "{{ nginx_http_params_defaults + my_extra_params }}" | ||
``` |
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.
Kudos for the documentation !
@@ -48,6 +48,8 @@ nginx_http_params: | |||
- server_tokens off | |||
- types_hash_max_size 2048 | |||
|
|||
nginx_http_params: { nginx_http_default_params } |
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 don't think this syntax is good, it break on CI : https://travis-ci.org/jdauphant/ansible-role-nginx/builds/189216001#L1713
It will be more : nginx_http_params: "{{ nginx_http_default_params }}"
@@ -38,7 +38,7 @@ nginx_extra_root_params: [] | |||
nginx_events_params: | |||
- worker_connections {% if nginx_max_clients is defined %}{{nginx_max_clients}}{% else %}512{% endif %} | |||
|
|||
nginx_http_params: | |||
nginx_http_default_params: |
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.
We can put this variable in the file "vars/main.yml" instead, it should not be changeable by the user
woops... sorry. I'll fix these asap . Did a quick/dirty job that fixed my issue and pull requested it naively. |
Update example-vars.yml
as suggested by @jdauphant
I updated the pull request. Also pulled in your changes from yesterday. |
@shrmrf Thanks for your help |
Add `nginx_http_extra_params` variable in default vars (jdauphant#149)
Hello Everyone, I would like to propose an additional variable in the
defaults/main.yml
file callednginx_http_extra_params
.Purpose
If someone wants to retain the defaults in
jdauphant.nginx/defaults/main.yml
and bring in additional variables tohttp_params
, he should be able to use thenginx_http_extra_params
variable. This would append tohttp_params
retaining the defaults.This would also help us in maintaining a common set of group_vars for nginx config and have additional params when needed for our deploys.
Example