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,9 +103,9 @@ nginx_vhosts_default:
# @var nginx_vhosts_default:example: >
# nginx_vhosts_default:
# - file: default
# upstream:
# name: my_pool
# servers: []
# upstreams:
# - name: my_pool
# servers: []
# servers:
# - port: 80
# server_name: demo.example.com

View File

@ -1,12 +1,14 @@
#jinja2: lstrip_blocks: True
{{ 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 {{ item.upstream.name }} {
{% for upserver in item.upstream.servers %}
upstream {{ upstream.name }} {
{% for upserver in upstream.servers %}
server {{ upserver }};
{% endfor %}
}
{% endfor %}
{% endif %}
{% for server in item.servers %}