Replace matrix-mailer with an external role
This commit is contained in:
@ -21,6 +21,12 @@
|
||||
block:
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/cleanup_usr_local_bin.yml"
|
||||
|
||||
- tags:
|
||||
- setup-all
|
||||
- install-all
|
||||
block:
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/migrate_matrix_mailer.yml"
|
||||
|
||||
- when: devture_traefik_enabled | bool
|
||||
tags:
|
||||
- setup-all
|
||||
|
@ -0,0 +1,39 @@
|
||||
---
|
||||
|
||||
# This migrates the mailer from the old path (`/matrix/mailer`) to the new path (`/matrix/exim-relay`, controlled by `exim_relay_base_path`),
|
||||
# and from the old hardcoded systemd service name (`matrix-mailer.service`) to the new one (`matrix-exim-relay.service`, controlled by `exim_relay_identifier`).
|
||||
#
|
||||
# Here, we merely disable (and stop) the old systemd service and relocate the base directory path (`/matrix/mailer`).
|
||||
# The exim-relay role itself (running later) will then ensure this data is up-to-date and will set up the new systemd service.
|
||||
|
||||
# It only makes sense to migrate if the identifier or path are different than the default (what we were using before).
|
||||
- name: Check existence of matrix-mailer.service systemd service
|
||||
ansible.builtin.stat:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mailer.service"
|
||||
register: matrix_mailer_service_stat
|
||||
|
||||
- when: matrix_mailer_service_stat.stat.exists | bool
|
||||
block:
|
||||
- name: Ensure matrix-mailer.service systemd service is stopped
|
||||
ansible.builtin.systemd:
|
||||
name: matrix-mailer
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Ensure matrix-mailer directory relocated
|
||||
ansible.builtin.command:
|
||||
cmd: "mv {{ matrix_base_data_path }}/mailer {{ exim_relay_base_path }}"
|
||||
creates: "{{ exim_relay_base_path }}"
|
||||
removes: "{{ matrix_base_data_path }}"
|
||||
|
||||
# Remove legacy env-mailer file (named `env` in the new role)
|
||||
- name: Ensure old exim-relay environment variables file is deleted
|
||||
ansible.builtin.file:
|
||||
path: "{{ exim_relay_base_path }}/env-mailer"
|
||||
state: absent
|
||||
|
||||
- name: Ensure matrix-mailer.service systemd service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mailer.service"
|
||||
state: absent
|
@ -59,6 +59,9 @@
|
||||
- {'old': 'matrix_prosody_jitsi_max_participants', 'new': 'jitsi_prosody_max_participants'}
|
||||
- {'old': 'jitsi_require_well_known', 'new': 'jitsi_web_well_known_element_jitsi_enabled'}
|
||||
- {'old': 'jitsi_wellknown_element_jitsi_json', 'new': 'jitsi_web_well_known_element_jitsi_json'}
|
||||
- {'old': 'exim_relay_docker_image', 'new': 'exim_relay_container_image'}
|
||||
- {'old': 'exim_relay_docker_image_name_prefix', 'new': 'exim_relay_container_image_name_prefix'}
|
||||
- {'old': 'exim_relay_docker_image_force_pull', 'new': 'exim_relay_container_image_force_pull'}
|
||||
|
||||
- name: (Deprecation) Catch and report matrix_postgres variables
|
||||
ansible.builtin.fail:
|
||||
@ -74,6 +77,17 @@
|
||||
The following variables in your configuration need to be renamed: {{ vars | dict2items | selectattr('key', 'match', 'matrix_postgres_.*') | map (attribute='key') | join(', ') }}
|
||||
when: "vars | dict2items | selectattr('key', 'match', 'matrix_postgres_.*') | list | items2dict"
|
||||
|
||||
- name: (Deprecation) Catch and report matrix_mailer_ variables
|
||||
ansible.builtin.fail:
|
||||
msg: |-
|
||||
The matrix-mailer role in the playbook has been replaced with the exim-relay role (https://github.com/mother-of-all-self-hosting/ansible-role-exim-relay).
|
||||
The new role is pretty much the same, but uses differently named variables.
|
||||
|
||||
Please change your configuration (vars.yml) to rename all `matrix_mailer`-prefixed variables (`matrix_mailer_*` -> `exim_relay_*`).
|
||||
|
||||
The following variables in your configuration need to be renamed: {{ vars | dict2items | selectattr('key', 'match', 'matrix_mailer_.*') | map (attribute='key') | join(', ') }}
|
||||
when: "vars | dict2items | selectattr('key', 'match', 'matrix_mailer_.*') | list | items2dict"
|
||||
|
||||
- when: matrix_playbook_migration_matrix_prometheus_node_exporter_migration_validation_enabled | bool
|
||||
block:
|
||||
- ansible.builtin.set_fact:
|
||||
|
Reference in New Issue
Block a user