Compare commits

..

21 Commits

Author SHA1 Message Date
c635181990
feat: add automatic creation of reverse-proxy routing 2021-08-10 06:59:03 +02:00
47cf179ef4
meta: move inventory structure to be more usable 2021-08-10 06:59:02 +02:00
95cbdc8be4
meta: add own inventory, add vault-unlock with GPG 2021-08-10 06:59:01 +02:00
Slavi Pantaleev
24b89f8288
Merge pull request #1223 from rndmh3ro/fix_irc_imagetag
irc appservice image tag has a 'v' now
2021-08-09 20:26:50 +03:00
Sebastian Gumprich
24589b91f4 irc appservice image tag has a 'v' now 2021-08-09 19:01:51 +02:00
Slavi Pantaleev
6de8b5925a
Merge pull request #1222 from wol-win/feature/signal
New version of Mautrix Signal bridge (version 0.2.0)
2021-08-09 13:59:17 +03:00
Slavi Pantaleev
f54f2827c4
Merge pull request #1221 from thomwiggers/patch-4
Update IRC appservice
2021-08-09 13:58:19 +03:00
Wolfgang Winter
6ecfbe98b1 New version of Mautrix Signal bridge version 0.2.0 provided through new GitLab repository location 2021-08-09 11:19:12 +02:00
Thom Wiggers
d11d6f52ae
Update IRC appservice
https://github.com/matrix-org/matrix-appservice-irc/releases/tag/0.29.0
2021-08-09 10:57:45 +02:00
Slavi Pantaleev
f9bc5e2cb6
Merge pull request #1217 from rndmh3ro/patch-1
whatsapp bridge has new docker image location
2021-08-07 19:15:25 +03:00
Sebastian Gumprich
d2a1b8b134
whatsapp bridge has new docker image location
See https://github.com/mautrix/whatsapp/releases/tag/v0.1.8
2021-08-07 15:47:24 +02:00
Slavi Pantaleev
2e23166ed3
Merge pull request #1216 from aaronraimist/hydrogen
Upgrade Hydrogen (0.2.3 -> 0.2.5)
2021-08-07 11:34:04 +03:00
Aaron Raimist
f3aae70f70
Upgrade Hydrogen (0.2.3 -> 0.2.5) 2021-08-07 02:47:51 -05:00
Slavi Pantaleev
23006fd64e Fix email2matrix path initialization
Regression since 421f85defa
2021-08-04 17:59:49 +03:00
Slavi Pantaleev
421f85defa Add self-building support to matrix-email2matrix 2021-08-04 15:03:45 +03:00
Slavi Pantaleev
2697590d28 Remove some useless if conditions 2021-08-04 14:51:15 +03:00
Slavi Pantaleev
a68ac9cb4f Split install/uninstall tasks in matrix-email2matrix 2021-08-04 14:45:07 +03:00
Slavi Pantaleev
5fc61ed964 Upgrade Element (1.7.33 -> 1.7.34) 2021-08-04 09:09:35 +03:00
Slavi Pantaleev
5575ad8117
Merge pull request #1211 from 0xLAITH/patch-1
Update howto-server-delegation.md
2021-08-02 12:05:32 +03:00
Slavi Pantaleev
519eef9e4b Remove unnecessary argument from Postgres import command
The default of using the `matrix` database is better anyway.
2021-08-02 10:08:30 +03:00
0xLAITH
dca876a8f0
Update howto-server-delegation.md
The attached code for the "Serving the Federation API with your certificates and matrix-nginx-proxy" section suggests using the matrix.<your-domain> certificate for the federation API as opposed to the necessary <your-domain> certificate for the federation to work. This can cause some confusion to readers.
2021-08-01 19:34:54 +00:00
18 changed files with 143 additions and 118 deletions

View File

@ -82,8 +82,8 @@ Based on your setup, you have different ways to go about it:
#
# NOTE: these are in-container paths. `/matrix/ssl` on the host is mounted into the container
# at the same path (`/matrix/ssl`) by default, so if that's the path you need, it would be seamless.
matrix_nginx_proxy_proxy_matrix_federation_api_ssl_certificate: /matrix/ssl/config/live/matrix.<your-domain>/fullchain.pem
matrix_nginx_proxy_proxy_matrix_federation_api_ssl_certificate_key: /matrix/ssl/config/live/matrix.<your-domain>/privkey.pem
matrix_nginx_proxy_proxy_matrix_federation_api_ssl_certificate: /matrix/ssl/config/live/<your-domain>/fullchain.pem
matrix_nginx_proxy_proxy_matrix_federation_api_ssl_certificate_key: /matrix/ssl/config/live/<your-domain>/privkey.pem
```
If your files are not in `/matrix/ssl` but in some other location, you would need to mount them into the container:

View File

@ -23,7 +23,7 @@ To import, run this command (make sure to replace `<server-path-to-postgres-dump
```sh
ansible-playbook -i inventory/hosts setup.yml \
--extra-vars='postgres_default_import_database=synapse server_path_postgres_dump=<server-path-to-postgres-dump.sql>' \
--extra-vars='server_path_postgres_dump=<server-path-to-postgres-dump.sql>' \
--tags=import-postgres
```

View File

@ -29,6 +29,7 @@ List of roles where self-building the Docker image is currently possible:
- `matrix-bridge-mx-puppet-skype`
- `matrix-bot-mjolnir`
- `matrix-bot-matrix-reminder-bot`
- `matrix-email2matrix`
Adding self-building support to other roles is welcome. Feel free to contribute!

View File

@ -1037,6 +1037,8 @@ matrix_dynamic_dns_enabled: false
matrix_email2matrix_enabled: false
matrix_email2matrix_container_image_self_build: "{{ matrix_architecture != 'amd64' }}"
######################################################################
#
# /matrix-email2matrix

View File

@ -7,7 +7,7 @@ matrix_appservice_irc_container_self_build: false
matrix_appservice_irc_docker_repo: "https://github.com/matrix-org/matrix-appservice-irc.git"
matrix_appservice_irc_docker_src_files_path: "{{ matrix_base_data_path }}/appservice-irc/docker-src"
matrix_appservice_irc_version: release-0.27.0
matrix_appservice_irc_version: release-v0.29.0
matrix_appservice_irc_docker_image: "{{ matrix_container_global_registry_prefix }}matrixdotorg/matrix-appservice-irc:{{ matrix_appservice_irc_version }}"
matrix_appservice_irc_docker_image_force_pull: "{{ matrix_appservice_irc_docker_image.endswith(':latest') }}"

View File

@ -40,7 +40,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_mautrix_facebook_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_facebook_docker_image_force_pull }}"
when: matrix_mautrix_facebook_enabled|bool and not matrix_mautrix_facebook_container_image_self_build
when: not matrix_mautrix_facebook_container_image_self_build
- name: Ensure Mautrix Facebook paths exist
file:
@ -63,7 +63,7 @@
# version: "{{ matrix_coturn_docker_image.split(':')[1] }}"
force: "yes"
register: matrix_mautrix_facebook_git_pull_results
when: "matrix_mautrix_facebook_enabled|bool and matrix_mautrix_facebook_container_image_self_build"
when: "matrix_mautrix_facebook_container_image_self_build|bool"
- name: Ensure Mautrix Facebook Docker image is built
docker_image:
@ -75,7 +75,7 @@
dockerfile: Dockerfile
path: "{{ matrix_mautrix_facebook_docker_src_files_path }}"
pull: yes
when: "matrix_mautrix_facebook_enabled|bool and matrix_mautrix_facebook_container_image_self_build|bool"
when: "matrix_mautrix_facebook_container_image_self_build|bool"
- name: Check if an old database file already exists
stat:

View File

@ -40,7 +40,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_mautrix_hangouts_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_hangouts_docker_image_force_pull }}"
when: matrix_mautrix_hangouts_enabled|bool and not matrix_mautrix_hangouts_container_image_self_build
when: not matrix_mautrix_hangouts_container_image_self_build
- name: Ensure Mautrix Hangouts paths exist
file:
@ -54,7 +54,7 @@
- { path: "{{ matrix_mautrix_hangouts_config_path }}", when: true }
- { path: "{{ matrix_mautrix_hangouts_data_path }}", when: true }
- { path: "{{ matrix_mautrix_hangouts_docker_src_files_path }}", when: "{{ matrix_mautrix_hangouts_container_image_self_build }}" }
when: matrix_mautrix_hangouts_enabled|bool and item.when|bool
when: "item.when|bool"
- name: Ensure Mautrix Hangots repository is present on self build
git:
@ -62,7 +62,7 @@
dest: "{{ matrix_mautrix_hangouts_docker_src_files_path }}"
force: "yes"
register: matrix_mautrix_hangouts_git_pull_results
when: "matrix_mautrix_hangouts_enabled|bool and matrix_mautrix_hangouts_container_image_self_build|bool"
when: "matrix_mautrix_hangouts_container_image_self_build|bool"
- name: Ensure Mautrix Hangouts Docker image is built
docker_image:
@ -74,7 +74,7 @@
dockerfile: Dockerfile
path: "{{ matrix_mautrix_hangouts_docker_src_files_path }}"
pull: yes
when: "matrix_mautrix_hangouts_enabled|bool and matrix_mautrix_hangouts_container_image_self_build|bool"
when: "matrix_mautrix_hangouts_container_image_self_build|bool"
- name: Check if an old database file already exists
stat:

View File

@ -13,7 +13,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_mautrix_instagram_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_instagram_docker_image_force_pull }}"
when: matrix_mautrix_instagram_enabled|bool and not matrix_mautrix_instagram_container_image_self_build
when: not matrix_mautrix_instagram_container_image_self_build
- name: Ensure Mautrix instagram paths exist
file:
@ -38,7 +38,7 @@
dest: "{{ matrix_mautrix_instagram_docker_src_files_path }}"
force: "yes"
register: matrix_mautrix_instagram_git_pull_results
when: "matrix_mautrix_instagram_enabled|bool and matrix_mautrix_instagram_container_image_self_build"
when: "matrix_mautrix_instagram_container_image_self_build|bool"
- name: Ensure Mautrix instagram Docker image is built
docker_image:
@ -50,7 +50,7 @@
dockerfile: Dockerfile
path: "{{ matrix_mautrix_instagram_docker_src_files_path }}"
pull: yes
when: "matrix_mautrix_instagram_enabled|bool and matrix_mautrix_instagram_container_image_self_build|bool"
when: "matrix_mautrix_instagram_container_image_self_build|bool"
- name: Ensure mautrix-instagram config.yaml installed
copy:

View File

@ -1,16 +1,16 @@
# mautrix-signal is a Matrix <-> Signal bridge
# See: https://github.com/tulir/mautrix-signal
# See: https://github.com/mautrix/signal
matrix_mautrix_signal_enabled: true
matrix_mautrix_signal_container_self_build: false
matrix_mautrix_signal_docker_repo: "https://mau.dev/tulir/mautrix-signal.git"
matrix_mautrix_signal_docker_repo: "https://mau.dev/mautrix/signal.git"
matrix_mautrix_signal_docker_src_files_path: "{{ matrix_base_data_path }}/mautrix-signal/docker-src"
matrix_mautrix_signal_version: latest
matrix_mautrix_signal_daemon_version: latest
# See: https://mau.dev/tulir/mautrix-signal/container_registry
matrix_mautrix_signal_docker_image: "dock.mau.dev/tulir/mautrix-signal:{{ matrix_mautrix_signal_version }}"
# See: https://mau.dev/mautrix/signal/container_registry
matrix_mautrix_signal_docker_image: "dock.mau.dev/mautrix/signal:{{ matrix_mautrix_signal_version }}"
matrix_mautrix_signal_docker_image_force_pull: "{{ matrix_mautrix_signal_docker_image.endswith(':latest') }}"
matrix_mautrix_signal_daemon_container_self_build: false

View File

@ -14,7 +14,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_mautrix_signal_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_signal_docker_image_force_pull }}"
when: "matrix_mautrix_signal_enabled|bool and not matrix_mautrix_signal_container_self_build|bool"
when: "not matrix_mautrix_signal_container_self_build|bool"
- name: Ensure Mautrix Signal repository is present on self-build
@ -23,7 +23,7 @@
dest: "{{ matrix_mautrix_signal_docker_src_files_path }}"
force: "yes"
register: matrix_mautrix_signal_git_pull_results
when: "matrix_mautrix_signal_enabled|bool and matrix_mautrix_signal_container_self_build|bool"
when: "matrix_mautrix_signal_container_self_build|bool"
- name: Ensure Mautrix Signal image is built
docker_image:
@ -35,7 +35,7 @@
dockerfile: Dockerfile
path: "{{ matrix_mautrix_signal_docker_src_files_path }}"
pull: yes
when: "matrix_mautrix_signal_enabled|bool and matrix_mautrix_signal_container_self_build|bool"
when: "matrix_mautrix_signal_container_self_build|bool"
- name: Ensure Mautrix Signal Daemon image is pulled
@ -53,7 +53,7 @@
dest: "{{ matrix_mautrix_signal_daemon_docker_src_files_path }}"
force: "yes"
register: matrix_mautrix_signal_daemon_git_pull_results
when: "matrix_mautrix_signal_enabled|bool and matrix_mautrix_signal_daemon_container_self_build|bool"
when: "matrix_mautrix_signal_daemon_container_self_build|bool"
- name: Ensure Mautrix Signal Daemon image is built
docker_image:
@ -65,7 +65,7 @@
dockerfile: Dockerfile
path: "{{ matrix_mautrix_signal_daemon_docker_src_files_path }}"
pull: yes
when: "matrix_mautrix_signal_enabled|bool and matrix_mautrix_signal_daemon_container_self_build|bool"
when: "matrix_mautrix_signal_daemon_container_self_build|bool"
- name: Ensure Mautrix Signal paths exist
file:

View File

@ -5,7 +5,7 @@ matrix_mautrix_whatsapp_enabled: true
matrix_mautrix_whatsapp_version: latest
# See: https://mau.dev/tulir/mautrix-whatsapp/container_registry
matrix_mautrix_whatsapp_docker_image: "dock.mau.dev/tulir/mautrix-whatsapp:{{ matrix_mautrix_whatsapp_version }}"
matrix_mautrix_whatsapp_docker_image: "dock.mau.dev/mautrix/whatsapp:{{ matrix_mautrix_whatsapp_version }}"
matrix_mautrix_whatsapp_docker_image_force_pull: "{{ matrix_mautrix_whatsapp_docker_image.endswith(':latest') }}"
matrix_mautrix_whatsapp_base_path: "{{ matrix_base_data_path }}/mautrix-whatsapp"

View File

@ -3,7 +3,7 @@ matrix_client_element_enabled: true
matrix_client_element_container_image_self_build: false
matrix_client_element_container_image_self_build_repo: "https://github.com/vector-im/riot-web.git"
matrix_client_element_version: v1.7.33
matrix_client_element_version: v1.7.34
matrix_client_element_docker_image: "{{ matrix_client_element_docker_image_name_prefix }}vectorim/element-web:{{ matrix_client_element_version }}"
matrix_client_element_docker_image_name_prefix: "{{ 'localhost/' if matrix_client_element_container_image_self_build else matrix_container_global_registry_prefix }}"
matrix_client_element_docker_image_force_pull: "{{ matrix_client_element_docker_image.endswith(':latest') }}"

View File

@ -5,7 +5,7 @@ matrix_client_hydrogen_enabled: true
matrix_client_hydrogen_container_image_self_build: true
matrix_client_hydrogen_container_image_self_build_repo: "https://github.com/vector-im/hydrogen-web.git"
matrix_client_hydrogen_version: v0.2.3
matrix_client_hydrogen_version: v0.2.5
matrix_client_hydrogen_docker_image: "{{ matrix_client_hydrogen_docker_image_name_prefix }}vectorim/hydrogen-web:{{ matrix_client_hydrogen_version }}"
matrix_client_hydrogen_docker_image_name_prefix: "{{ 'localhost/' if matrix_client_hydrogen_container_image_self_build }}"
matrix_client_hydrogen_docker_image_force_pull: "{{ matrix_client_hydrogen_docker_image.endswith(':latest') }}"

View File

@ -2,9 +2,15 @@ matrix_email2matrix_enabled: true
matrix_email2matrix_base_path: "{{ matrix_base_data_path }}/email2matrix"
matrix_email2matrix_config_dir_path: "{{ matrix_email2matrix_base_path }}/config"
matrix_email2matrix_docker_src_files_path: "{{ matrix_email2matrix_base_path }}/docker-src"
matrix_email2matrix_container_image_self_build: false
matrix_email2matrix_container_image_self_build_repo: "https://github.com/devture/email2matrix.git"
matrix_email2matrix_container_image_self_build_branch: "{{ matrix_email2matrix_version }}"
matrix_email2matrix_version: 1.0.1
matrix_email2matrix_docker_image: "{{ matrix_container_global_registry_prefix }}devture/email2matrix:{{ matrix_email2matrix_version }}"
matrix_email2matrix_docker_image_prefix: "{{ 'localhost/' if matrix_email2matrix_container_image_self_build else matrix_container_global_registry_prefix }}"
matrix_email2matrix_docker_image: "{{ matrix_email2matrix_docker_image_prefix }}devture/email2matrix:{{ matrix_email2matrix_version }}"
matrix_email2matrix_docker_image_force_pull: "{{ matrix_email2matrix_docker_image.endswith(':latest') }}"
# A list of extra arguments to pass to the container

View File

@ -8,8 +8,14 @@
- setup-all
- setup-email2matrix
- import_tasks: "{{ role_path }}/tasks/setup_email2matrix.yml"
when: run_setup|bool
- import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup|bool and matrix_email2matrix_enabled|bool"
tags:
- setup-all
- setup-email2matrix
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup|bool and not matrix_email2matrix_enabled|bool"
tags:
- setup-all
- setup-email2matrix

View File

@ -1,88 +0,0 @@
---
#
# Tasks related to setting up Email2Matrix
#
- name: Ensure Email2Matrix paths exist
file:
path: "{{ item }}"
state: directory
mode: 0750
owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}"
with_items:
- "{{ matrix_email2matrix_base_path }}"
- "{{ matrix_email2matrix_config_dir_path }}"
when: matrix_email2matrix_enabled|bool
- name: Ensure Email2Matrix configuration file created
template:
src: "{{ role_path }}/templates/config.json.j2"
dest: "{{ matrix_email2matrix_config_dir_path }}/config.json"
owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}"
mode: 0640
when: matrix_email2matrix_enabled|bool
- name: Ensure Email2Matrix image is pulled
docker_image:
name: "{{ matrix_email2matrix_docker_image }}"
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_email2matrix_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_email2matrix_docker_image_force_pull }}"
when: matrix_email2matrix_enabled|bool
- name: Ensure matrix-email2matrix.service installed
template:
src: "{{ role_path }}/templates/systemd/matrix-email2matrix.service.j2"
dest: "{{ matrix_systemd_path }}/matrix-email2matrix.service"
mode: 0644
register: matrix_email2matrix_systemd_service_result
when: matrix_email2matrix_enabled|bool
- name: Ensure systemd reloaded after matrix-email2matrix.service installation
service:
daemon_reload: yes
when: "matrix_email2matrix_enabled|bool and matrix_email2matrix_systemd_service_result.changed"
#
# Tasks related to getting rid of the Email2Matrix (if it was previously enabled)
#
- name: Check existence of matrix-email2matrix service
stat:
path: "{{ matrix_systemd_path }}/matrix-email2matrix.service"
register: matrix_email2matrix_service_stat
when: "not matrix_email2matrix_enabled|bool"
- name: Ensure matrix-email2matrix is stopped
service:
name: matrix-email2matrix
state: stopped
daemon_reload: yes
register: stopping_result
when: "not matrix_email2matrix_enabled|bool and matrix_email2matrix_service_stat.stat.exists"
- name: Ensure matrix-email2matrix.service doesn't exist
file:
path: "{{ matrix_systemd_path }}/matrix-email2matrix.service"
state: absent
when: "not matrix_email2matrix_enabled|bool and matrix_email2matrix_service_stat.stat.exists"
- name: Ensure systemd reloaded after matrix-email2matrix.service removal
service:
daemon_reload: yes
when: "not matrix_email2matrix_enabled|bool and matrix_email2matrix_service_stat.stat.exists"
- name: Ensure Email2Matrix data path doesn't exist
file:
path: "{{ matrix_email2matrix_base_path }}"
state: absent
when: "not matrix_email2matrix_enabled|bool"
- name: Ensure Email2Matrix Docker image doesn't exist
docker_image:
name: "{{ matrix_email2matrix_docker_image }}"
state: absent
when: "not matrix_email2matrix_enabled|bool"

View File

@ -0,0 +1,63 @@
---
- name: Ensure Email2Matrix paths exist
file:
path: "{{ item.path }}"
state: directory
mode: 0750
owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}"
with_items:
- { path: "{{ matrix_email2matrix_base_path }}", when: true }
- { path: "{{ matrix_email2matrix_config_dir_path }}", when: true }
- { path: "{{ matrix_email2matrix_docker_src_files_path }}", when: "{{ matrix_email2matrix_container_image_self_build }}"}
when: "item.when|bool"
- name: Ensure Email2Matrix configuration file created
template:
src: "{{ role_path }}/templates/config.json.j2"
dest: "{{ matrix_email2matrix_config_dir_path }}/config.json"
owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}"
mode: 0640
- name: Ensure Email2Matrix image is pulled
docker_image:
name: "{{ matrix_email2matrix_docker_image }}"
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_email2matrix_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_email2matrix_docker_image_force_pull }}"
when: "not matrix_email2matrix_container_image_self_build|bool"
- name: Ensure Email2Matrix repository is present on self-build
git:
repo: "{{ matrix_email2matrix_container_image_self_build_repo }}"
dest: "{{ matrix_email2matrix_docker_src_files_path }}"
version: "{{ matrix_email2matrix_container_image_self_build_branch }}"
force: "yes"
register: matrix_email2matrix_git_pull_results
when: "matrix_email2matrix_container_image_self_build|bool"
- name: Ensure Email2Matrix Docker image is built
docker_image:
name: "{{ matrix_email2matrix_docker_image }}"
source: build
force_source: "{{ matrix_email2matrix_git_pull_results.changed if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_email2matrix_git_pull_results.changed }}"
build:
dockerfile: etc/docker/Dockerfile
path: "{{ matrix_email2matrix_docker_src_files_path }}"
pull: yes
when: "matrix_email2matrix_container_image_self_build|bool"
- name: Ensure matrix-email2matrix.service installed
template:
src: "{{ role_path }}/templates/systemd/matrix-email2matrix.service.j2"
dest: "{{ matrix_systemd_path }}/matrix-email2matrix.service"
mode: 0644
register: matrix_email2matrix_systemd_service_result
- name: Ensure systemd reloaded after matrix-email2matrix.service installation
service:
daemon_reload: yes
when: "matrix_email2matrix_systemd_service_result.changed|bool"

View File

@ -0,0 +1,35 @@
---
- name: Check existence of matrix-email2matrix service
stat:
path: "{{ matrix_systemd_path }}/matrix-email2matrix.service"
register: matrix_email2matrix_service_stat
- name: Ensure matrix-email2matrix is stopped
service:
name: matrix-email2matrix
state: stopped
daemon_reload: yes
register: stopping_result
when: "matrix_email2matrix_service_stat.stat.exists|bool"
- name: Ensure matrix-email2matrix.service doesn't exist
file:
path: "{{ matrix_systemd_path }}/matrix-email2matrix.service"
state: absent
when: "matrix_email2matrix_service_stat.stat.exists|bool"
- name: Ensure systemd reloaded after matrix-email2matrix.service removal
service:
daemon_reload: yes
when: "matrix_email2matrix_service_stat.stat.exists|bool"
- name: Ensure Email2Matrix data path doesn't exist
file:
path: "{{ matrix_email2matrix_base_path }}"
state: absent
- name: Ensure Email2Matrix Docker image doesn't exist
docker_image:
name: "{{ matrix_email2matrix_docker_image }}"
state: absent