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

@@ -1,15 +1,18 @@
---
- name: include docker vars
include_vars: vars/docker-database-service.yml.j2
- name: create central database
include_role:
name: docker-{{database_type}}
when: enable_central_database | bool
- name: "include create-domains.yml"
include_tasks: create-domains.yml
loop: "{{ domains }}"
loop_control:
loop_var: domain
- name: create database in central Postgres
include_role:
name: docker-postgres
when: enable_central_database | bool
- name: "create {{docker_compose_instance_directory}}"
file:
path: "{{docker_compose_instance_directory}}"

View File

@@ -18,7 +18,7 @@ services:
{% if not enable_central_database %}
- database
{% include 'templates/docker-postgres-service.yml.j2' %}
{% include 'templates/docker-{{ database_type }}-service.yml.j2' %}
{% endif %}
{% include 'templates/docker-redis-service.yml.j2' %}
@@ -27,9 +27,7 @@ services:
- .env
volumes:
assets:
{% if not enable_central_database %}
database:
{% endif %}
{% include 'templates/docker-database-volume.yml.j2' %}
data:
redis:
config:

View File

@@ -1,6 +1,3 @@
docker_compose_project_name: "peertube"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/"
database_host: "database"
database_databasename: "{{docker_compose_project_name}}"
database_username: "{{docker_compose_project_name}}"
database_type: "mariadb"
database_password: "{{peertube_database_password}}"