Add Support for Networks String List

This commit is contained in:
Simon Caron 2022-06-13 23:36:40 -04:00 committed by Corbin Bartsch
parent ec7c196064
commit effb62c3e6
Signed by: coredotbin
GPG Key ID: B03E030E4322E9D5

View File

@ -21,6 +21,11 @@ services:
{% endif %}
{% if container.networks is defined %}
networks:
{% if container.networks is iterable and (container.networks is not string and container.networks is not mapping) %}
{% for network in container.networks %}
- {{ network }}
{% endfor %}
{% else %}
{% for network, params in container.networks.items() %}
{{ network }}:
{% if params.aliases is defined %}
@ -31,6 +36,7 @@ services:
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% if container.build is defined %}
build: {{ container.build }}
{% endif %}
@ -219,6 +225,7 @@ services:
{% if networks is defined %}
networks:
{% for network in networks %}
{% if network.active %}
{{ network.network_name }}:
{% if network.external is defined %}
external: {{ network.external }}
@ -226,5 +233,6 @@ networks:
{% if network.driver is defined %}
driver: {{ network.driver }}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}