Add healthcheck and dependency conditions
This commit is contained in:
parent
9846f2f03a
commit
cf59c5f807
@ -1,4 +1,7 @@
|
|||||||
{{ ansible_managed | comment }}
|
{{ ansible_managed | comment }}
|
||||||
|
##############################
|
||||||
|
# If you're seeing this, you're using a symlinked version of this role.
|
||||||
|
##############################
|
||||||
---
|
---
|
||||||
version: "{{ compose_schema_version | default('2') }}"
|
version: "{{ compose_schema_version | default('2') }}"
|
||||||
services:
|
services:
|
||||||
@ -74,7 +77,12 @@ services:
|
|||||||
{% if container.depends_on is defined %}
|
{% if container.depends_on is defined %}
|
||||||
depends_on:
|
depends_on:
|
||||||
{% for dependent in container.depends_on %}
|
{% for dependent in container.depends_on %}
|
||||||
|
{% if dependent.condition is defined %}
|
||||||
|
{{ dependent }}:
|
||||||
|
condition: {{ dependent.condition }}
|
||||||
|
{% else %}
|
||||||
- {{ dependent }}
|
- {{ dependent }}
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if container.hostname is defined %}
|
{% if container.hostname is defined %}
|
||||||
@ -154,8 +162,15 @@ services:
|
|||||||
- {{ envfile }}
|
- {{ envfile }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if container.user is defined %}
|
{% if container.healthcheck is defined %}
|
||||||
user: {{ container.user }}
|
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 %}
|
{% endif %}
|
||||||
{% if container.restart is defined %}
|
{% if container.restart is defined %}
|
||||||
restart: {{ container.restart }}
|
restart: {{ container.restart }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user