Implemented vars, tasks and templates for central database setup until mastodon role

This commit is contained in:
2024-01-02 21:13:34 +01:00
parent 4e09fbd3fb
commit ab7ca07ac9
76 changed files with 431 additions and 467 deletions

View File

@@ -0,0 +1,3 @@
{% if not enable_central_database %}
database:
{% endif %}

View File

@@ -0,0 +1,5 @@
{% if enable_central_database %}
depends_on:
database:
condition: service_healthy
{% endif %}

View File

@@ -1,3 +1,4 @@
{% if not enable_central_database %}
database:
logging:
driver: journald
@@ -16,4 +17,7 @@
test: "/usr/bin/mariadb --user={{database_username}} --password={{database_password}} --execute \"SHOW DATABASES;\""
interval: 3s
timeout: 1s
retries: 5
retries: 5
networks:
- {{docker_compose_project_name}}_network
{% endif %}

View File

@@ -0,0 +1,5 @@
networks:
- {{docker_compose_project_name}}_network
{% if enable_central_database %}
- central_{{ database_type }}_network
{% endif %}

View File

@@ -0,0 +1,6 @@
networks:
{% if enable_central_database %}
central_{{ database_type }}_network:
external: true
{% endif %}
{{docker_compose_project_name}}_network:

View File

@@ -1,4 +1,4 @@
{% if not enable_central_database %}
database:
image: postgres:{{database_version}}-alpine
environment:
@@ -13,6 +13,9 @@
timeout: 5s
retries: 6
volumes:
- type: volume
- type: volume
source: database
target: /var/lib/postgresql/data
networks:
- {{docker_compose_project_name}}_network
{% endif %}

View File

@@ -9,4 +9,6 @@
test: ["CMD", "redis-cli", "ping"]
interval: 1s
timeout: 3s
retries: 30
retries: 30
networks:
- {{docker_compose_project_name}}_network