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,4 +1,12 @@
---
- 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: receive {{ mail_interface_domain }} certificate
command: certbot certonly --agree-tos --email {{ administrator_email }} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{ mail_interface_domain }}
@@ -11,10 +19,5 @@
dest: "{{nginx_servers_directory}}{{domain}}.conf"
notify: restart nginx
- name: Create database in central MariaDB
include_role:
name: docker-mariadb
when: enable_central_database | bool
- name: "include tasks update-repository-with-docker-compose.yml"
include_tasks: update-repository-with-docker-compose.yml

View File

@@ -4,47 +4,40 @@ services:
image: attendize_web:latest
ports:
- "{{http_port}}:80"
#- "8081:443"
volumes:
- .:/usr/share/nginx/html
- .:/var/www
depends_on:
{% if not enable_central_database %}
- database
{% endif %}
- maildev
- redis
- worker
{% include 'templates/docker-depends-on-central-database.yml.j2' %}
maildev:
redis:
worker:
env_file:
- ./.env
{% include 'templates/docker-networks-for-container.yml.j2' %}
worker:
image: attendize_worker:latest
depends_on:
{% if not enable_central_database %}
- database
{% endif %}
- maildev
- redis
{% include 'templates/docker-depends-on-central-database.yml.j2' %}
maildev:
redis:
{% include 'templates/docker-networks-for-container.yml.j2' %}
volumes:
- .:/usr/share/nginx/html
- .:/var/www
{% include 'templates/docker-{{ database_type }}-service.yml.j2' %}
maildev:
image: maildev/maildev
ports:
- "{{ mail_interface_http_port }}:1080"
{% include 'templates/docker-networks-for-container.yml.j2' %}
{% include 'templates/docker-depends-on-central-database.yml.j2' %}
{% include 'templates/docker-redis-service.yml.j2' %}
{% if not enable_central_database %}
depends_on:
- database
{% include 'templates/docker-mariadb-service.yml.j2' %}
{% endif %}
volumes:
redis:
{% if not enable_central_database %}
database:
{% endif %}
{% include 'templates/docker-database-volume.yml.j2' %}
{% include 'templates/docker-networks-for-role.yml.j2' %}

View File

@@ -1,11 +1,8 @@
---
docker_compose_project_name: "attendize"
docker_compose_instance_directory: "{{path_docker_compose_instances}}{{docker_compose_project_name}}/"
docker_compose_file_path: "{{docker_compose_instance_directory}}docker-compose.yml"
docker_compose_backup_path: "/tmp/{{docker_compose_project_name}}-docker-compose-backup.yml"
mail_interface_domain: "mail.{{domain}}"
database_host: "database"
database_databasename: "{{docker_compose_project_name}}"
database_username: "{{docker_compose_project_name}}"
database_type: "mariadb"
database_password: "{{attendize_database_password}}"
repository_address: "https://github.com/Attendize/Attendize.git"