Add healthcheck and dependency conditions
This commit is contained in:
parent
9846f2f03a
commit
cf59c5f807
@ -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 }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user