diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index 4741b95..3842474 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -1,4 +1,7 @@ {{ ansible_managed | comment }} +############################## +# If you're seeing this, you're using a symlinked version of this role. +############################## --- version: "{{ compose_schema_version | default('2') }}" services: @@ -74,7 +77,12 @@ services: {% if container.depends_on is defined %} depends_on: {% for dependent in container.depends_on %} +{% if dependent.condition is defined %} + {{ dependent }}: + condition: {{ dependent.condition }} +{% else %} - {{ dependent }} +{% endif %} {% endfor %} {% endif %} {% if container.hostname is defined %} @@ -154,8 +162,15 @@ services: - {{ envfile }} {% endfor %} {% endif %} -{% if container.user is defined %} - user: {{ container.user }} +{% if container.healthcheck is defined %} + healthcheck: + test: {{ container.healthcheck.test }} + interval: {{ container.healthcheck.interval }} + timeout: {{ container.healthcheck.timeout }} +{% if container.healthcheck.retries is defined %} + retries: {{ container.healthcheck.retries }} +{% endif %} + start_period: {{ container.healthcheck.start_period }} {% endif %} {% if container.restart is defined %} restart: {{ container.restart }}