From 90383ce9f19f52cd4adad7f099532b4e5e2b2a8c Mon Sep 17 00:00:00 2001 From: IronicBadger Date: Mon, 14 Sep 2020 11:50:55 -0400 Subject: [PATCH] fixed extra_hosts and global_env_vars defaults --- templates/docker-compose.yml.j2 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index 6dec7c5..6f7407c 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -6,11 +6,11 @@ services: {% if container.active %} {{ container.service_name }}: image: {{ container.image }} - container_name: {{ container.container_name }} + container_name: {{ container.container_name | default(container.service_name) }} {% if container.extra_hosts is defined %} extra_hosts: -{% for extra_host in extra_hosts %} - - {{ extra_host }} +{% for host in container.extra_hosts %} + - {{ host }} {% endfor %} {% endif %} {% if container.network_mode is defined %} @@ -36,7 +36,7 @@ services: {% endif %} {% if ( container.environment is defined ) or ( container.include_global_env_vars is defined and container.include_global_env_vars) %} environment: -{% if container.include_global_env_vars %} +{% if container.include_global_env_vars | default(false) %} {% for global_var in global_env_vars %} - {{ global_var }} {% endfor %} @@ -87,4 +87,4 @@ services: {% endfor %} {% endif %} {% endif %} -{% endfor %} +{% endfor %} \ No newline at end of file