Merge branch 'master' into bye-bye-nginx-proxy

This commit is contained in:
Slavi Pantaleev
2024-01-05 17:55:49 +02:00
25 changed files with 150 additions and 237 deletions

View File

@ -7,7 +7,7 @@
# The Traefik 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).
- when: "devture_traefik_identifier != 'devture-postgres' or devture_traefik_base_path != '/devture-traefik'"
- when: "devture_traefik_identifier != 'devture-traefik' or devture_traefik_base_path != '/devture-traefik'"
block:
- name: Check existence of devture-traefik.service systemd service
ansible.builtin.stat:

View File

@ -27,6 +27,12 @@
block:
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/cleanup_matrix_static_files_well_known.yml"
- tags:
- setup-all
- install-all
block:
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/cleanup_matrix_static_files_well_known.yml"
- when: devture_traefik_enabled | bool
tags:
- setup-all

View File

@ -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

View File

@ -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'}
- {'old': 'matrix_nginx_proxy_proxy_matrix_metrics_enabled', 'new': 'matrix_metrics_exposure_enabled'}
- {'old': 'matrix_nginx_proxy_proxy_matrix_metrics_basic_auth_enabled', 'new': 'matrix_metrics_exposure_http_basic_auth_enabled'}
@ -106,6 +109,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: