From 2935b69f777cad348914e108654992f72821c115 Mon Sep 17 00:00:00 2001 From: nd Date: Sun, 18 Oct 2020 18:40:35 +0200 Subject: [PATCH 1/2] add php-bcmath to php-fpm module --- tasks/php-fpm.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/php-fpm.yml b/tasks/php-fpm.yml index 01d7749..0cedf4d 100644 --- a/tasks/php-fpm.yml +++ b/tasks/php-fpm.yml @@ -25,6 +25,7 @@ - php-pdo-pgsql - php-pdo-mysql - php-apcu + - php-bcmath notify: - restart nginx - restart php-fpm From fb6e4a91d187c95349b7c302258bf25bb47ab4f6 Mon Sep 17 00:00:00 2001 From: Fabian Freyer Date: Sun, 18 Oct 2020 18:42:23 +0200 Subject: [PATCH 2/2] [PATCH] Add support for adding more upstream attributes --- templates/upstreams.conf.j2 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/templates/upstreams.conf.j2 b/templates/upstreams.conf.j2 index 4b96fe9..ecb7123 100644 --- a/templates/upstreams.conf.j2 +++ b/templates/upstreams.conf.j2 @@ -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 %} {% set upstream = nginx.upstreams[upstreamname] %} upstream {{ upstreamname }} { {% for s in upstream.server %} - server {{ s.address }} {%if s.resolve|d(False) %}resolve{% endif %}; + server {{ s.address }}{{ upstream_attributes(s) }}; {% endfor %} }