allow multiple upstream groups from list
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2020-01-20 14:37:38 +01:00
parent 4f1f3036dd
commit 5a1a3e6ef1
2 changed files with 8 additions and 6 deletions

View File

@ -103,8 +103,8 @@ nginx_vhosts_default:
# @var nginx_vhosts_default:example: > # @var nginx_vhosts_default:example: >
# nginx_vhosts_default: # nginx_vhosts_default:
# - file: default # - file: default
# upstream: # upstreams:
# name: my_pool # - name: my_pool
# servers: [] # servers: []
# servers: # servers:
# - port: 80 # - port: 80

View File

@ -1,12 +1,14 @@
#jinja2: lstrip_blocks: True #jinja2: lstrip_blocks: True
{{ ansible_managed | comment }} {{ ansible_managed | comment }}
{% if item.upstreams is defined and item.upstreams %}
{% for upstream in item.upstreams %}
{% if item.upstream is defined and item.upstream %} upstream {{ upstream.name }} {
upstream {{ item.upstream.name }} { {% for upserver in upstream.servers %}
{% for upserver in item.upstream.servers %}
server {{ upserver }}; server {{ upserver }};
{% endfor %} {% endfor %}
} }
{% endfor %}
{% endif %} {% endif %}
{% for server in item.servers %} {% for server in item.servers %}