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,12 +1,15 @@
---
- 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 tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml
- name: create database in central MariaDB
include_role:
name: docker-mariadb
when: enable_central_database | bool
- name: "create {{docker_compose_instance_directory}}"
file:
path: "{{docker_compose_instance_directory}}"

View File

@@ -1,6 +1,11 @@
version: '2'
services:
{% include 'templates/docker-{{ database_type }}-service.yml.j2' %}
{% include 'templates/docker-redis-service.yml.j2' %}
application:
image: zknt/pixelfed
restart: always
@@ -14,11 +19,8 @@ services:
- "./env:/var/www/.env"
ports:
- "{{http_port}}:80"
depends_on:
{% if not enable_central_database %}
- database
{% endif %}
- redis
{% include 'templates/docker-depends-on-central-database.yml.j2' %}
redis:
worker:
image: zknt/pixelfed
restart: always
@@ -36,22 +38,12 @@ services:
interval: 60s
timeout: 5s
retries: 1
depends_on:
- redis
- application
{% if not enable_central_database %}
- database
{% include 'templates/docker-mariadb-service.yml.j2' %}
{% endif %}
{% include 'templates/docker-redis-service.yml.j2' %}
{% include 'templates/docker-depends-on-central-database.yml.j2' %}
redis:
application:
volumes:
{% if not enable_central_database %}
database:
{% endif %}
{% include 'templates/docker-database-volume.yml.j2' %}
redis:
application_data:
bootstrap:

View File

@@ -1,7 +1,4 @@
docker_compose_project_name: "pixelfed"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/"
nginx_docker_reverse_proxy_extra_configuration: "client_max_body_size 512M;"
database_host: "database"
database_databasename: "{{docker_compose_project_name}}"
database_username: "{{docker_compose_project_name}}"
database_type: "mariadb"
database_password: "{{pixelfed_database_password}}"