Merge branch 'master' of ssh://git-ssh.notandy.de:2222/ansible/roles/nginx
This commit is contained in:
commit
4d44f889cc
2 changed files with 13 additions and 1 deletions
|
|
@ -25,6 +25,7 @@
|
||||||
- php-pdo-pgsql
|
- php-pdo-pgsql
|
||||||
- php-pdo-mysql
|
- php-pdo-mysql
|
||||||
- php-apcu
|
- php-apcu
|
||||||
|
- php-bcmath
|
||||||
notify:
|
notify:
|
||||||
- restart nginx
|
- restart nginx
|
||||||
- restart php-fpm
|
- restart php-fpm
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,19 @@
|
||||||
|
{% macro upstream_attribute(upstream, attr) %}{% if attr in upstream %} {{attr}}{% endif %}{% endmacro %}
|
||||||
|
{% macro upstream_attribute_value(upstream, attr) %}{% if attr in upstream %} {{attr}}={{ upstream[attr] }}{% endif %}{% endmacro %}
|
||||||
|
{% macro upstream_attributes(upstream) -%}
|
||||||
|
{%- for attr in ["resolve", "backup", "down", "drain"] -%}
|
||||||
|
{{- upstream_attribute(upstream, attr) -}}
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- for attr in ["weight", "fail_timeout", "max_fails", "max_conns", "route", "service", "slow_start"] -%}
|
||||||
|
{{- upstream_attribute_value(upstream, attr) -}}
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- endmacro %}
|
||||||
|
|
||||||
{% for upstreamname in nginx.upstreams %}
|
{% for upstreamname in nginx.upstreams %}
|
||||||
{% set upstream = nginx.upstreams[upstreamname] %}
|
{% set upstream = nginx.upstreams[upstreamname] %}
|
||||||
upstream {{ upstreamname }} {
|
upstream {{ upstreamname }} {
|
||||||
{% for s in upstream.server %}
|
{% for s in upstream.server %}
|
||||||
server {{ s.address }} {%if s.resolve|d(False) %}resolve {% endif %}max_fails={{ s.max_fails|d(5) }} fail_timeout={{ s.fail_timeout|d(10) }};
|
server {{ s.address }}{{ upstream_attributes(s) }};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue