From 51f47f158ecf82fd31dd026d8f5ea01866ba5b63 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 4 Jan 2024 10:15:46 +0100 Subject: [PATCH] Added linebreaks to prevent j2 rendering bug --- roles/docker-nextcloud/templates/docker-compose.yml.j2 | 2 +- templates/docker-compose-networks.yml.j2 | 3 ++- templates/docker-compose-volumes-just-database.yml.j2 | 3 ++- templates/docker-compose-volumes.yml.j2 | 3 ++- templates/docker-container-depends-on-also-database.yml.j2 | 3 ++- templates/docker-container-depends-on-database-redis.yml.j2 | 1 + templates/docker-container-depends-on-just-database.yml.j2 | 3 ++- templates/docker-container-networks.yml.j2 | 3 ++- templates/docker-service-mariadb.yml.j2 | 3 ++- templates/docker-service-postgres.yml.j2 | 3 ++- templates/docker-service-redis.yml.j2 | 3 ++- 11 files changed, 20 insertions(+), 10 deletions(-) diff --git a/roles/docker-nextcloud/templates/docker-compose.yml.j2 b/roles/docker-nextcloud/templates/docker-compose.yml.j2 index b7cbee05..0844581e 100644 --- a/roles/docker-nextcloud/templates/docker-compose.yml.j2 +++ b/roles/docker-nextcloud/templates/docker-compose.yml.j2 @@ -18,7 +18,7 @@ services: MYSQL_USER: "{{database_username}}" MYSQL_PASSWORD: "{{database_password}}" MYSQL_HOST: {{database_host}}:3306 -{% include 'templates/docker-container-depends-on-just-database.yml.j2' %} +{% include 'templates/docker-container-depends-on-database-redis.yml.j2' %} {% include 'templates/docker-container-networks.yml.j2' %} web: diff --git a/templates/docker-compose-networks.yml.j2 b/templates/docker-compose-networks.yml.j2 index 8d760849..c4fc368c 100644 --- a/templates/docker-compose-networks.yml.j2 +++ b/templates/docker-compose-networks.yml.j2 @@ -1,7 +1,8 @@ + # This template needs to be included in docker-compose.yml networks: {% if enable_central_database | bool %} central_{{ database_type }}_network: external: true {% endif %} - {{docker_compose_project_name}}_network: \ No newline at end of file + {{docker_compose_project_name}}_network: diff --git a/templates/docker-compose-volumes-just-database.yml.j2 b/templates/docker-compose-volumes-just-database.yml.j2 index 0e80e052..e8a5daa0 100644 --- a/templates/docker-compose-volumes-just-database.yml.j2 +++ b/templates/docker-compose-volumes-just-database.yml.j2 @@ -1,5 +1,6 @@ + # This needs to be included in docker-compose.yml which just contain a database volume {% if not enable_central_database | bool %} volumes: database: -{% endif %} \ No newline at end of file +{% endif %} diff --git a/templates/docker-compose-volumes.yml.j2 b/templates/docker-compose-volumes.yml.j2 index ece146f3..42fddfd9 100644 --- a/templates/docker-compose-volumes.yml.j2 +++ b/templates/docker-compose-volumes.yml.j2 @@ -1,5 +1,6 @@ + # This template needs to be included in docker-compose.yml which contain a database and additional volumes volumes: {% if not enable_central_database | bool %} database: -{% endif %} \ No newline at end of file +{% endif %} diff --git a/templates/docker-container-depends-on-also-database.yml.j2 b/templates/docker-container-depends-on-also-database.yml.j2 index b38b52bd..38901370 100644 --- a/templates/docker-container-depends-on-also-database.yml.j2 +++ b/templates/docker-container-depends-on-also-database.yml.j2 @@ -1,6 +1,7 @@ + # This template needs to be included in docker-compose.yml containers which depend on a database and additional containers depends_on: {% if not enable_central_database | bool %} database: condition: service_healthy -{% endif %} \ No newline at end of file +{% endif %} diff --git a/templates/docker-container-depends-on-database-redis.yml.j2 b/templates/docker-container-depends-on-database-redis.yml.j2 index 57ca0edf..755a0171 100644 --- a/templates/docker-container-depends-on-database-redis.yml.j2 +++ b/templates/docker-container-depends-on-database-redis.yml.j2 @@ -1,3 +1,4 @@ + # This template needs to be included in docker-compose.yml contaienrs, which depend on a database, redis and optional additional volumes depends_on: {% if not enable_central_database | bool %} diff --git a/templates/docker-container-depends-on-just-database.yml.j2 b/templates/docker-container-depends-on-just-database.yml.j2 index 9c41915c..974c1172 100644 --- a/templates/docker-container-depends-on-just-database.yml.j2 +++ b/templates/docker-container-depends-on-just-database.yml.j2 @@ -1,6 +1,7 @@ + # This template needs to be included in docker-compose.yml contaienrs, which just depend on a database {% if not enable_central_database | bool %} depends_on: database: condition: service_healthy -{% endif %} \ No newline at end of file +{% endif %} diff --git a/templates/docker-container-networks.yml.j2 b/templates/docker-container-networks.yml.j2 index 918e2bbd..a3d63af5 100644 --- a/templates/docker-container-networks.yml.j2 +++ b/templates/docker-container-networks.yml.j2 @@ -1,6 +1,7 @@ + # This template needs to be included in docker-compose.yml containers networks: {{docker_compose_project_name}}_network: {% if enable_central_database | bool %} central_{{ database_type }}_network: -{% endif %} \ No newline at end of file +{% endif %} diff --git a/templates/docker-service-mariadb.yml.j2 b/templates/docker-service-mariadb.yml.j2 index 5f249e37..1b240bb0 100644 --- a/templates/docker-service-mariadb.yml.j2 +++ b/templates/docker-service-mariadb.yml.j2 @@ -1,3 +1,4 @@ + # This template needs to be included in docker-compose.yml, which depend on a mariadb database {% if not enable_central_database | bool %} database: @@ -21,4 +22,4 @@ retries: 5 networks: - {{docker_compose_project_name}}_network -{% endif %} \ No newline at end of file +{% endif %} diff --git a/templates/docker-service-postgres.yml.j2 b/templates/docker-service-postgres.yml.j2 index b5159a17..e2ff4e69 100644 --- a/templates/docker-service-postgres.yml.j2 +++ b/templates/docker-service-postgres.yml.j2 @@ -1,3 +1,4 @@ + # This template needs to be included in docker-compose.yml, which depend on a postgres database {% if not enable_central_database | bool %} database: @@ -19,4 +20,4 @@ target: /var/lib/postgresql/data networks: - {{docker_compose_project_name}}_network -{% endif %} \ No newline at end of file +{% endif %} diff --git a/templates/docker-service-redis.yml.j2 b/templates/docker-service-redis.yml.j2 index 25aee6b8..0520b566 100644 --- a/templates/docker-service-redis.yml.j2 +++ b/templates/docker-service-redis.yml.j2 @@ -1,3 +1,4 @@ + # This template needs to be included in docker-compose.yml, which depend on redis redis: image: redis:alpine @@ -12,4 +13,4 @@ timeout: 3s retries: 30 networks: - - {{docker_compose_project_name}}_network \ No newline at end of file + - {{docker_compose_project_name}}_network