computer-playbook/roles/docker-mailu/tasks/main.yml

74 lines
2.1 KiB
YAML
Raw Normal View History

2020-12-27 13:22:47 +01:00
---
- name: "include docker-compose-database.yml"
include_tasks: docker-compose-database.yml
- name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml
2021-01-05 13:25:59 +01:00
vars:
nginx_docker_reverse_proxy_extra_configuration: "client_max_body_size 31M;"
2020-12-27 16:16:12 +01:00
2023-12-07 16:56:43 +01:00
- name: "create {{path_docker_compose_instances}}mailu"
2020-12-27 13:22:47 +01:00
file:
2023-12-07 16:56:43 +01:00
path: "{{path_docker_compose_instances}}mailu"
2020-12-28 21:24:32 +01:00
state: directory
mode: 0755
2021-04-05 16:22:55 +02:00
2023-04-26 14:38:02 +02:00
- name: "create {{path_administrator_scripts}}mailu"
2021-04-05 12:32:55 +02:00
file:
2023-04-26 14:38:02 +02:00
path: "{{path_administrator_scripts}}mailu"
2021-10-18 18:46:58 +02:00
state: directory
mode: 0755
- name: "create /etc/mailu/"
file:
path: "/etc/mailu"
2021-04-05 12:32:55 +02:00
state: directory
mode: 0755
2020-12-28 21:24:32 +01:00
2021-10-18 18:46:58 +02:00
- name: "create /etc/mailu/certs"
2020-12-28 21:24:32 +01:00
file:
2021-10-18 18:46:58 +02:00
path: "/etc/mailu/certs"
2020-12-27 13:22:47 +01:00
state: directory
mode: 0755
2023-04-19 00:03:13 +02:00
- name: add docker-compose.yml
2023-04-26 11:52:11 +02:00
template:
src: "docker-compose.yml.j2"
2023-12-05 18:45:26 +01:00
dest: "{{docker_compose_instance_directory}}docker-compose.yml"
notify: docker compose project setup
2020-12-27 13:22:47 +01:00
2020-12-27 19:41:35 +01:00
- name: add mailu.env
2023-04-26 11:52:11 +02:00
template:
src: "mailu.env.j2"
2023-12-05 18:45:26 +01:00
dest: "{{docker_compose_instance_directory}}mailu.env"
notify: docker compose project setup
2021-04-05 12:32:55 +02:00
- name: add deploy-letsencrypt-mailu.sh
2023-04-26 11:52:11 +02:00
template:
src: "deploy-letsencrypt-mailu.sh.j2"
2023-04-26 14:38:02 +02:00
dest: "{{path_administrator_scripts}}mailu/deploy-letsencrypt-mailu.sh"
2021-04-05 12:32:55 +02:00
- name: configure deploy-letsencrypt-mailu.service
2023-04-26 11:52:11 +02:00
template:
src: "deploy-letsencrypt-mailu.service.j2"
dest: "/etc/systemd/system/deploy-letsencrypt-mailu.service"
2021-04-05 12:32:55 +02:00
notify: restart deploy-letsencrypt-mailu.service
2021-04-05 16:22:55 +02:00
2024-01-04 13:27:07 +01:00
- name: "include role for systemd-timer for {{service_name}}"
include_role:
name: systemd-timer
vars:
on_calendar: "{{on_calendar_deploy_mailu_certificates}}"
service_name: "deploy-letsencrypt-mailu"
persistent: "true"
- name: flush docker service
meta: flush_handlers
when: setup | bool
- name: execute database migration
command:
cmd: "docker compose -p mailu exec admin flask mailu admin admin {{top_domain}} {{mailu_initial_root_password}}"
chdir: "{{docker_compose_instance_directory}}"
2024-01-08 09:41:59 +01:00
ignore_errors: true
when: setup | bool