mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Implemented vars, tasks and templates for central database setup until mastodon role
This commit is contained in:
3
templates/docker-database-volume.yml.j2
Normal file
3
templates/docker-database-volume.yml.j2
Normal file
@@ -0,0 +1,3 @@
|
||||
{% if not enable_central_database %}
|
||||
database:
|
||||
{% endif %}
|
5
templates/docker-depends-on-central-database.yml.j2
Normal file
5
templates/docker-depends-on-central-database.yml.j2
Normal file
@@ -0,0 +1,5 @@
|
||||
{% if enable_central_database %}
|
||||
depends_on:
|
||||
database:
|
||||
condition: service_healthy
|
||||
{% endif %}
|
@@ -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 %}
|
0
templates/docker-network-for-container-add.yml.j2
Normal file
0
templates/docker-network-for-container-add.yml.j2
Normal file
5
templates/docker-networks-for-container.yml.j2
Normal file
5
templates/docker-networks-for-container.yml.j2
Normal file
@@ -0,0 +1,5 @@
|
||||
networks:
|
||||
- {{docker_compose_project_name}}_network
|
||||
{% if enable_central_database %}
|
||||
- central_{{ database_type }}_network
|
||||
{% endif %}
|
6
templates/docker-networks-for-role.yml.j2
Normal file
6
templates/docker-networks-for-role.yml.j2
Normal file
@@ -0,0 +1,6 @@
|
||||
networks:
|
||||
{% if enable_central_database %}
|
||||
central_{{ database_type }}_network:
|
||||
external: true
|
||||
{% endif %}
|
||||
{{docker_compose_project_name}}_network:
|
@@ -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 %}
|
@@ -9,4 +9,6 @@
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 1s
|
||||
timeout: 3s
|
||||
retries: 30
|
||||
retries: 30
|
||||
networks:
|
||||
- {{docker_compose_project_name}}_network
|
Reference in New Issue
Block a user