mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
General optimations and debugging
This commit is contained in:
@@ -17,7 +17,7 @@ The following templates are available under `roles/docker-container/templates/`:
|
||||
- `central_ldap` when LDAP feature and network are enabled
|
||||
- `default`
|
||||
|
||||
- **depends_on_dmbs.j2**
|
||||
- **depends_on_dmbs.yml.j2**
|
||||
Builds a `depends_on:` block automatically:
|
||||
- If `central_database` is **off**, renders an empty list `depends_on: []`
|
||||
- Otherwise, includes `database` and/or `redis` with healthcheck conditions
|
||||
|
@@ -0,0 +1,8 @@
|
||||
{% if not applications | is_feature_enabled('central_database',application_id) %}
|
||||
{{ database_host }}:
|
||||
condition: service_healthy
|
||||
{% endif %}
|
||||
{% if applications[application_id].docker.services.redis.enabled | default(false) | bool %}
|
||||
redis:
|
||||
condition: service_healthy
|
||||
{% endif %}
|
@@ -0,0 +1,9 @@
|
||||
{# This template needs to be included in docker-compose.yml containers, which depend on a database, redis and optional additional volumes #}
|
||||
{% if
|
||||
(applications[application_id].docker.services.redis.enabled | default(false)| bool) or
|
||||
not applications | is_feature_enabled('central_database',application_id)
|
||||
%}
|
||||
depends_on:
|
||||
{% include "roles/docker-container/templates/depends_on/dbms_base.yml.j2" %}
|
||||
{% endif %}
|
||||
{{ "\n" }}
|
@@ -0,0 +1,4 @@
|
||||
{# This template needs to be included in docker-compose.yml containers, which depend on a database, redis and optional additional volumes #}
|
||||
depends_on:
|
||||
{% include "roles/docker-container/templates/depends_on/dbms_base.yml.j2" %}
|
||||
{{ "\n" }}
|
@@ -1,18 +0,0 @@
|
||||
{# This template needs to be included in docker-compose.yml containers, which depend on a database, redis and optional additional volumes #}
|
||||
{% if applications | is_feature_enabled('central_database', application_id)
|
||||
and not (applications[application_id].docker.services.redis.enabled
|
||||
| default(false)
|
||||
| bool) %}
|
||||
depends_on: []
|
||||
{% else %}
|
||||
depends_on:
|
||||
{% if not applications | is_feature_enabled('central_database', application_id) %}
|
||||
database:
|
||||
condition: service_healthy
|
||||
{% endif %}
|
||||
{% if applications[application_id].docker.services.redis.enabled | default(false) | bool %}
|
||||
redis:
|
||||
condition: service_healthy
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{{ "\n" }}
|
Reference in New Issue
Block a user