jdauphant / ansible-role-nginx

Ansible role to install and manage nginx configuration
655 stars 302 forks source link

Fix for the issue "Map directive does not work in http section #198" #199

Closed kevit closed 6 years ago

kevit commented 6 years ago

adding a special map section for http config

jdauphant commented 6 years ago

Hello Kevit, Thanks for your help. This induce a change of behavior between variable of the role (should I put ; or not ?). I will prefer using the new notation ( https://github.com/jdauphant/ansible-role-nginx/issues/154#issuecomment-274165382 , BTW you have the solution at your problem by using nginx_config )

We can still implement it on nginx_http_params (but we may deprecate nginx_http_params in profit of nginx_config). In that case, something like that should work:

 {% for v in nginx_http_params %}
 {% if v.find(';') != -1 %}
          {{ v }}
 {% else %}
          {{ v }};
 {% endif %}
 {% endfor %}
jdauphant commented 6 years ago

@kevit Hello, have you checked my answer ?