5
0
mirror of https://github.com/spantaleev/matrix-docker-ansible-deploy.git synced 2026-07-19 08:09:36 +00:00

Rename matrix_mautrix_telegram_* variables to matrix_bridge_mautrix_telegram_*

Part of adopting a uniform naming policy for bridge variables,
where the variable prefix matches the role directory name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Slavi Pantaleev
2026-07-16 14:55:25 +03:00
parent ace4edb01b
commit e751673b0d
12 changed files with 388 additions and 388 deletions
@@ -12,15 +12,15 @@
- install-all
- install-mautrix-telegram
block:
- when: matrix_mautrix_telegram_enabled | bool
- when: matrix_bridge_mautrix_telegram_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
- when: matrix_mautrix_telegram_enabled | bool
- when: matrix_bridge_mautrix_telegram_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
- tags:
- setup-all
- setup-mautrix-telegram
block:
- when: not matrix_mautrix_telegram_enabled | bool
- when: not matrix_bridge_mautrix_telegram_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
@@ -18,7 +18,7 @@
---
- ansible.builtin.set_fact:
matrix_mautrix_telegram_migration_requires_restart: false
matrix_bridge_mautrix_telegram_migration_requires_restart: false
# The legacy Python bridge stored its SQLite DB at `{base_path}/mautrix-telegram.db` (the role's
# root). Later, we started relocating it to `{base_path}/data/mautrix-telegram.db`. The sqlite→
@@ -27,10 +27,10 @@
# switch to Postgres wouldn't actually get their data imported before the service starts.
- name: Check if a legacy-location SQLite database exists
ansible.builtin.stat:
path: "{{ matrix_mautrix_telegram_base_path }}/mautrix-telegram.db"
register: matrix_mautrix_telegram_stat_database_legacy_location
path: "{{ matrix_bridge_mautrix_telegram_base_path }}/mautrix-telegram.db"
register: matrix_bridge_mautrix_telegram_stat_database_legacy_location
- when: matrix_mautrix_telegram_stat_database_legacy_location.stat.exists | bool
- when: matrix_bridge_mautrix_telegram_stat_database_legacy_location.stat.exists | bool
block:
- name: Ensure matrix-mautrix-telegram.service is stopped before relocating legacy SQLite DB
ansible.builtin.service:
@@ -42,7 +42,7 @@
- name: Ensure data directory exists for legacy SQLite DB relocation
ansible.builtin.file:
path: "{{ matrix_mautrix_telegram_data_path }}"
path: "{{ matrix_bridge_mautrix_telegram_data_path }}"
state: directory
mode: '0750'
owner: "{{ matrix_user_name }}"
@@ -50,34 +50,34 @@
- name: (Data relocation) Move mautrix-telegram SQLite DB from legacy location to data directory
ansible.builtin.command:
cmd: "mv {{ matrix_mautrix_telegram_base_path }}/mautrix-telegram.db {{ matrix_mautrix_telegram_data_path }}/mautrix-telegram.db"
creates: "{{ matrix_mautrix_telegram_data_path }}/mautrix-telegram.db"
removes: "{{ matrix_mautrix_telegram_base_path }}/mautrix-telegram.db"
cmd: "mv {{ matrix_bridge_mautrix_telegram_base_path }}/mautrix-telegram.db {{ matrix_bridge_mautrix_telegram_data_path }}/mautrix-telegram.db"
creates: "{{ matrix_bridge_mautrix_telegram_data_path }}/mautrix-telegram.db"
removes: "{{ matrix_bridge_mautrix_telegram_base_path }}/mautrix-telegram.db"
- when: "matrix_mautrix_telegram_database_engine == 'postgres'"
- when: "matrix_bridge_mautrix_telegram_database_engine == 'postgres'"
block:
- name: Check if an SQLite database already exists
ansible.builtin.stat:
path: "{{ matrix_mautrix_telegram_sqlite_database_path_local }}"
register: matrix_mautrix_telegram_sqlite_database_path_local_stat_result
path: "{{ matrix_bridge_mautrix_telegram_sqlite_database_path_local }}"
register: matrix_bridge_mautrix_telegram_sqlite_database_path_local_stat_result
- when: "matrix_mautrix_telegram_sqlite_database_path_local_stat_result.stat.exists | bool"
- when: "matrix_bridge_mautrix_telegram_sqlite_database_path_local_stat_result.stat.exists | bool"
block:
- ansible.builtin.include_role:
name: galaxy/postgres
tasks_from: migrate_db_to_postgres
vars:
postgres_db_migration_request:
src: "{{ matrix_mautrix_telegram_sqlite_database_path_local }}"
dst: "{{ matrix_mautrix_telegram_database_connection_string }}"
src: "{{ matrix_bridge_mautrix_telegram_sqlite_database_path_local }}"
dst: "{{ matrix_bridge_mautrix_telegram_database_connection_string }}"
caller: "{{ role_path | basename }}"
engine_variable_name: 'matrix_mautrix_telegram_database_engine'
engine_variable_name: 'matrix_bridge_mautrix_telegram_database_engine'
engine_old: 'sqlite'
systemd_services_to_stop: ['matrix-mautrix-telegram.service']
pgloader_options: ['--with "quote identifiers"']
- ansible.builtin.set_fact:
matrix_mautrix_telegram_migration_requires_restart: true
matrix_bridge_mautrix_telegram_migration_requires_restart: true
- name: Ensure Mautrix Telegram paths exist
ansible.builtin.file:
@@ -87,77 +87,77 @@
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
with_items:
- {path: "{{ matrix_mautrix_telegram_base_path }}", when: true}
- {path: "{{ matrix_mautrix_telegram_config_path }}", when: true}
- {path: "{{ matrix_mautrix_telegram_data_path }}", when: true}
- {path: "{{ matrix_mautrix_telegram_container_src_files_path }}", when: "{{ matrix_mautrix_telegram_container_image_self_build }}"}
- {path: "{{ matrix_bridge_mautrix_telegram_base_path }}", when: true}
- {path: "{{ matrix_bridge_mautrix_telegram_config_path }}", when: true}
- {path: "{{ matrix_bridge_mautrix_telegram_data_path }}", when: true}
- {path: "{{ matrix_bridge_mautrix_telegram_container_src_files_path }}", when: "{{ matrix_bridge_mautrix_telegram_container_image_self_build }}"}
when: item.when | bool
- name: Ensure Mautrix Telegram image is pulled
community.docker.docker_image_pull:
name: "{{ matrix_mautrix_telegram_container_image }}"
name: "{{ matrix_bridge_mautrix_telegram_container_image }}"
pull: always
when: "not matrix_mautrix_telegram_container_image_self_build | bool"
register: matrix_mautrix_telegram_container_image_pull_result
when: "not matrix_bridge_mautrix_telegram_container_image_self_build | bool"
register: matrix_bridge_mautrix_telegram_container_image_pull_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: matrix_mautrix_telegram_container_image_pull_result is not failed
until: matrix_bridge_mautrix_telegram_container_image_pull_result is not failed
- name: Ensure Mautrix Telegram repository is present on self-build
ansible.builtin.git:
repo: "{{ matrix_mautrix_telegram_container_image_self_build_repo }}"
dest: "{{ matrix_mautrix_telegram_container_src_files_path }}"
version: "{{ matrix_mautrix_telegram_container_image_self_build_branch }}"
repo: "{{ matrix_bridge_mautrix_telegram_container_image_self_build_repo }}"
dest: "{{ matrix_bridge_mautrix_telegram_container_src_files_path }}"
version: "{{ matrix_bridge_mautrix_telegram_container_image_self_build_branch }}"
force: "yes"
become: true
become_user: "{{ matrix_user_name }}"
register: matrix_mautrix_telegram_git_pull_results
when: "matrix_mautrix_telegram_container_image_self_build | bool"
register: matrix_bridge_mautrix_telegram_git_pull_results
when: "matrix_bridge_mautrix_telegram_container_image_self_build | bool"
- name: Ensure Mautrix Telegram Docker image is built
community.docker.docker_image_build:
name: "{{ matrix_mautrix_telegram_container_image }}"
name: "{{ matrix_bridge_mautrix_telegram_container_image }}"
dockerfile: Dockerfile
path: "{{ matrix_mautrix_telegram_container_src_files_path }}"
path: "{{ matrix_bridge_mautrix_telegram_container_src_files_path }}"
pull: true
rebuild: "{{ 'always' if matrix_mautrix_telegram_git_pull_results.changed | bool else 'never' }}"
when: "matrix_mautrix_telegram_container_image_self_build | bool"
register: matrix_mautrix_telegram_container_image_build_result
rebuild: "{{ 'always' if matrix_bridge_mautrix_telegram_git_pull_results.changed | bool else 'never' }}"
when: "matrix_bridge_mautrix_telegram_container_image_self_build | bool"
register: matrix_bridge_mautrix_telegram_container_image_build_result
- name: Ensure mautrix-telegram config.yaml installed
ansible.builtin.copy:
content: "{{ matrix_mautrix_telegram_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_mautrix_telegram_config_path }}/config.yaml"
content: "{{ matrix_bridge_mautrix_telegram_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_bridge_mautrix_telegram_config_path }}/config.yaml"
mode: '0644'
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_mautrix_telegram_config_result
register: matrix_bridge_mautrix_telegram_config_result
- name: Ensure mautrix-telegram registration.yaml installed
ansible.builtin.copy:
content: "{{ matrix_mautrix_telegram_registration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_mautrix_telegram_config_path }}/registration.yaml"
content: "{{ matrix_bridge_mautrix_telegram_registration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_bridge_mautrix_telegram_config_path }}/registration.yaml"
mode: '0644'
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
register: matrix_mautrix_telegram_registration_result
register: matrix_bridge_mautrix_telegram_registration_result
- name: Ensure mautrix-telegram support files installed
ansible.builtin.template:
src: "{{ role_path }}/templates/{{ item }}.j2"
dest: "{{ matrix_mautrix_telegram_base_path }}/{{ item }}"
dest: "{{ matrix_bridge_mautrix_telegram_base_path }}/{{ item }}"
mode: '0640'
owner: "{{ matrix_user_name }}"
group: "{{ matrix_group_name }}"
with_items:
- labels
register: matrix_mautrix_telegram_support_files_result
register: matrix_bridge_mautrix_telegram_support_files_result
- name: Ensure matrix-mautrix-telegram container network is created
when: matrix_mautrix_telegram_container_network != 'host'
when: matrix_bridge_mautrix_telegram_container_network != 'host'
community.general.docker_network:
enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
name: "{{ matrix_mautrix_telegram_container_network }}"
name: "{{ matrix_bridge_mautrix_telegram_container_network }}"
driver: bridge
driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
@@ -166,19 +166,19 @@
src: "{{ role_path }}/templates/systemd/matrix-mautrix-telegram.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-telegram.service"
mode: '0644'
register: matrix_mautrix_telegram_systemd_service_result
register: matrix_bridge_mautrix_telegram_systemd_service_result
- name: Determine whether matrix-mautrix-telegram needs a restart
ansible.builtin.set_fact:
matrix_mautrix_telegram_restart_necessary: >-
matrix_bridge_mautrix_telegram_restart_necessary: >-
{{
matrix_mautrix_telegram_migration_requires_restart | default(false)
or matrix_mautrix_telegram_config_result.changed | default(false)
or matrix_mautrix_telegram_registration_result.changed | default(false)
or matrix_mautrix_telegram_support_files_result.changed | default(false)
or matrix_mautrix_telegram_systemd_service_result.changed | default(false)
or matrix_mautrix_telegram_container_image_pull_result.changed | default(false)
or matrix_mautrix_telegram_container_image_build_result.changed | default(false)
matrix_bridge_mautrix_telegram_migration_requires_restart | default(false)
or matrix_bridge_mautrix_telegram_config_result.changed | default(false)
or matrix_bridge_mautrix_telegram_registration_result.changed | default(false)
or matrix_bridge_mautrix_telegram_support_files_result.changed | default(false)
or matrix_bridge_mautrix_telegram_systemd_service_result.changed | default(false)
or matrix_bridge_mautrix_telegram_container_image_pull_result.changed | default(false)
or matrix_bridge_mautrix_telegram_container_image_build_result.changed | default(false)
}}
- name: Ensure matrix-mautrix-telegram.service restarted, if necessary
@@ -186,4 +186,4 @@
name: "matrix-mautrix-telegram.service"
state: restarted
daemon_reload: true
when: "matrix_mautrix_telegram_migration_requires_restart | bool"
when: "matrix_bridge_mautrix_telegram_migration_requires_restart | bool"
@@ -9,9 +9,9 @@
- name: Check existence of matrix-mautrix-telegram service
ansible.builtin.stat:
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mautrix-telegram.service"
register: matrix_mautrix_telegram_service_stat
register: matrix_bridge_mautrix_telegram_service_stat
- when: matrix_mautrix_telegram_service_stat.stat.exists | bool
- when: matrix_bridge_mautrix_telegram_service_stat.stat.exists | bool
block:
- name: Ensure matrix-mautrix-telegram is stopped
ansible.builtin.service:
@@ -13,66 +13,66 @@
Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml).
when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
with_items:
- {'old': 'matrix_mautrix_telegram_container_exposed_port_number', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_mautrix_telegram_container_self_build', 'new': 'matrix_mautrix_telegram_container_image_self_build'}
- {'old': 'matrix_mautrix_telegram_login_shared_secret', 'new': '<removed>'}
- {'old': 'matrix_mautrix_telegram_docker_image_name_prefix', 'new': 'matrix_mautrix_telegram_container_image_registry_prefix'}
- {'old': 'matrix_mautrix_telegram_docker_repo', 'new': 'matrix_mautrix_telegram_container_image_self_build_repo'}
- {'old': 'matrix_mautrix_telegram_docker_repo_version', 'new': 'matrix_mautrix_telegram_container_image_self_build_branch'}
- {'old': 'matrix_mautrix_telegram_docker_src_files_path', 'new': 'matrix_mautrix_telegram_container_src_files_path'}
- {'old': 'matrix_mautrix_telegram_docker_image', 'new': 'matrix_mautrix_telegram_container_image'}
- {'old': 'matrix_mautrix_telegram_docker_image_force_pull', 'new': 'matrix_mautrix_telegram_container_image_force_pull'}
- {'old': 'matrix_mautrix_telegram_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'}
- {'old': 'matrix_mautrix_telegram_docker_image_registry_prefix', 'new': 'matrix_mautrix_telegram_container_image_registry_prefix'}
- {'old': 'matrix_mautrix_telegram_docker_image_registry_prefix_upstream', 'new': 'matrix_mautrix_telegram_container_image_registry_prefix_upstream'}
- {'old': 'matrix_mautrix_telegram_docker_image_registry_prefix_upstream_default', 'new': 'matrix_mautrix_telegram_container_image_registry_prefix_upstream_default'}
- {'old': 'matrix_mautrix_telegram_container_repo', 'new': 'matrix_mautrix_telegram_container_image_self_build_repo'}
- {'old': 'matrix_mautrix_telegram_container_repo_version', 'new': 'matrix_mautrix_telegram_container_image_self_build_branch'}
- {'old': 'matrix_bridge_mautrix_telegram_container_exposed_port_number', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_bridge_mautrix_telegram_container_self_build', 'new': 'matrix_bridge_mautrix_telegram_container_image_self_build'}
- {'old': 'matrix_bridge_mautrix_telegram_login_shared_secret', 'new': '<removed>'}
- {'old': 'matrix_bridge_mautrix_telegram_docker_image_name_prefix', 'new': 'matrix_bridge_mautrix_telegram_container_image_registry_prefix'}
- {'old': 'matrix_bridge_mautrix_telegram_docker_repo', 'new': 'matrix_bridge_mautrix_telegram_container_image_self_build_repo'}
- {'old': 'matrix_bridge_mautrix_telegram_docker_repo_version', 'new': 'matrix_bridge_mautrix_telegram_container_image_self_build_branch'}
- {'old': 'matrix_bridge_mautrix_telegram_docker_src_files_path', 'new': 'matrix_bridge_mautrix_telegram_container_src_files_path'}
- {'old': 'matrix_bridge_mautrix_telegram_docker_image', 'new': 'matrix_bridge_mautrix_telegram_container_image'}
- {'old': 'matrix_bridge_mautrix_telegram_docker_image_force_pull', 'new': 'matrix_bridge_mautrix_telegram_container_image_force_pull'}
- {'old': 'matrix_bridge_mautrix_telegram_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'}
- {'old': 'matrix_bridge_mautrix_telegram_docker_image_registry_prefix', 'new': 'matrix_bridge_mautrix_telegram_container_image_registry_prefix'}
- {'old': 'matrix_bridge_mautrix_telegram_docker_image_registry_prefix_upstream', 'new': 'matrix_bridge_mautrix_telegram_container_image_registry_prefix_upstream'}
- {'old': 'matrix_bridge_mautrix_telegram_docker_image_registry_prefix_upstream_default', 'new': 'matrix_bridge_mautrix_telegram_container_image_registry_prefix_upstream_default'}
- {'old': 'matrix_bridge_mautrix_telegram_container_repo', 'new': 'matrix_bridge_mautrix_telegram_container_image_self_build_repo'}
- {'old': 'matrix_bridge_mautrix_telegram_container_repo_version', 'new': 'matrix_bridge_mautrix_telegram_container_image_self_build_branch'}
# Variables removed in the bridgev2 (Go) rewrite — mautrix-telegram no longer has a Python runtime,
# a separate lottieconverter container or a web-based login endpoint.
# (matrix_mautrix_telegram_scheme was part of this group too, but has since been reintroduced to configure the bridge's HTTP API exposure address, so it's intentionally not listed here.)
- {'old': 'matrix_mautrix_telegram_hostname', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_mautrix_telegram_path_prefix', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_mautrix_telegram_public_endpoint', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_mautrix_telegram_appservice_public_enabled', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_mautrix_telegram_appservice_public_external', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_mautrix_telegram_container_labels_public_endpoint_enabled', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_mautrix_telegram_container_labels_public_endpoint_hostname', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_mautrix_telegram_container_labels_public_endpoint_path_prefix', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_mautrix_telegram_container_labels_public_endpoint_traefik_rule', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_mautrix_telegram_container_labels_public_endpoint_traefik_priority', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_mautrix_telegram_container_labels_public_endpoint_traefik_entrypoints', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_mautrix_telegram_container_labels_public_endpoint_traefik_tls', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_mautrix_telegram_container_labels_public_endpoint_traefik_tls_certResolver', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_mautrix_telegram_container_http_host_bind_port', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_mautrix_telegram_filter_mode', 'new': '<removed (not available in the bridgev2 rewrite of mautrix-telegram)>'}
- {'old': 'matrix_mautrix_telegram_bot_token', 'new': '<removed; the old-style relaybot is gone — use the common bridge relay mode (matrix_mautrix_telegram_bridge_relay_enabled) instead>'}
- {'old': 'matrix_mautrix_telegram_bridge_login_shared_secret_map', 'new': '<superseded by matrix_mautrix_telegram_double_puppet_secrets>'}
- {'old': 'matrix_mautrix_telegram_bridge_login_shared_secret_map_auto', 'new': '<superseded by matrix_mautrix_telegram_double_puppet_secrets_auto>'}
- {'old': 'matrix_mautrix_telegram_bridge_login_shared_secret_map_custom', 'new': '<superseded by matrix_mautrix_telegram_double_puppet_secrets_custom>'}
- {'old': 'matrix_mautrix_telegram_username_template', 'new': '<removed (no longer configurable via a single variable; use matrix_mautrix_telegram_configuration_extension_yaml if needed)>'}
- {'old': 'matrix_mautrix_telegram_alias_template', 'new': '<removed (room aliases are no longer created by the bridgev2 rewrite of mautrix-telegram)>'}
- {'old': 'matrix_mautrix_telegram_displayname_template', 'new': '<superseded by matrix_mautrix_telegram_network_displayname_template (note: the syntax has changed to Go templates)>'}
- {'old': 'matrix_mautrix_telegram_appservice_database', 'new': '<superseded by matrix_mautrix_telegram_appservice_database_uri>'}
- {'old': 'matrix_mautrix_telegram_lottieconverter_container_image_self_build', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_mautrix_telegram_lottieconverter_container_image_self_build_mask_arch', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_mautrix_telegram_lottieconverter_container_repo', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_mautrix_telegram_lottieconverter_container_repo_version', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_mautrix_telegram_lottieconverter_container_src_files_path', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_mautrix_telegram_lottieconverter_container_image', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_mautrix_telegram_lottieconverter_container_image_registry_prefix', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_mautrix_telegram_lottieconverter_container_image_registry_prefix_upstream', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_mautrix_telegram_lottieconverter_container_image_registry_prefix_upstream_default', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
# (matrix_bridge_mautrix_telegram_scheme was part of this group too, but has since been reintroduced to configure the bridge's HTTP API exposure address, so it's intentionally not listed here.)
- {'old': 'matrix_bridge_mautrix_telegram_hostname', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_bridge_mautrix_telegram_path_prefix', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_bridge_mautrix_telegram_public_endpoint', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_bridge_mautrix_telegram_appservice_public_enabled', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_bridge_mautrix_telegram_appservice_public_external', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_bridge_mautrix_telegram_container_labels_public_endpoint_enabled', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_bridge_mautrix_telegram_container_labels_public_endpoint_hostname', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_bridge_mautrix_telegram_container_labels_public_endpoint_path_prefix', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_bridge_mautrix_telegram_container_labels_public_endpoint_traefik_rule', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_bridge_mautrix_telegram_container_labels_public_endpoint_traefik_priority', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_bridge_mautrix_telegram_container_labels_public_endpoint_traefik_entrypoints', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_bridge_mautrix_telegram_container_labels_public_endpoint_traefik_tls', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_bridge_mautrix_telegram_container_labels_public_endpoint_traefik_tls_certResolver', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_bridge_mautrix_telegram_container_http_host_bind_port', 'new': '<removed (the bridge no longer has a public web-based login endpoint)>'}
- {'old': 'matrix_bridge_mautrix_telegram_filter_mode', 'new': '<removed (not available in the bridgev2 rewrite of mautrix-telegram)>'}
- {'old': 'matrix_bridge_mautrix_telegram_bot_token', 'new': '<removed; the old-style relaybot is gone — use the common bridge relay mode (matrix_bridge_mautrix_telegram_bridge_relay_enabled) instead>'}
- {'old': 'matrix_bridge_mautrix_telegram_bridge_login_shared_secret_map', 'new': '<superseded by matrix_bridge_mautrix_telegram_double_puppet_secrets>'}
- {'old': 'matrix_bridge_mautrix_telegram_bridge_login_shared_secret_map_auto', 'new': '<superseded by matrix_bridge_mautrix_telegram_double_puppet_secrets_auto>'}
- {'old': 'matrix_bridge_mautrix_telegram_bridge_login_shared_secret_map_custom', 'new': '<superseded by matrix_bridge_mautrix_telegram_double_puppet_secrets_custom>'}
- {'old': 'matrix_bridge_mautrix_telegram_username_template', 'new': '<removed (no longer configurable via a single variable; use matrix_bridge_mautrix_telegram_configuration_extension_yaml if needed)>'}
- {'old': 'matrix_bridge_mautrix_telegram_alias_template', 'new': '<removed (room aliases are no longer created by the bridgev2 rewrite of mautrix-telegram)>'}
- {'old': 'matrix_bridge_mautrix_telegram_displayname_template', 'new': '<superseded by matrix_bridge_mautrix_telegram_network_displayname_template (note: the syntax has changed to Go templates)>'}
- {'old': 'matrix_bridge_mautrix_telegram_appservice_database', 'new': '<superseded by matrix_bridge_mautrix_telegram_appservice_database_uri>'}
- {'old': 'matrix_bridge_mautrix_telegram_lottieconverter_container_image_self_build', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_bridge_mautrix_telegram_lottieconverter_container_image_self_build_mask_arch', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_bridge_mautrix_telegram_lottieconverter_container_repo', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_bridge_mautrix_telegram_lottieconverter_container_repo_version', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_bridge_mautrix_telegram_lottieconverter_container_src_files_path', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_bridge_mautrix_telegram_lottieconverter_container_image', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_bridge_mautrix_telegram_lottieconverter_container_image_registry_prefix', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_bridge_mautrix_telegram_lottieconverter_container_image_registry_prefix_upstream', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_bridge_mautrix_telegram_lottieconverter_container_image_registry_prefix_upstream_default', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
# Historical lottieconverter aliases from before the _docker_ → _container_ rename:
- {'old': 'matrix_mautrix_telegram_lottieconverter_container_self_build', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_mautrix_telegram_lottieconverter_docker_image_name_prefix', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_mautrix_telegram_lottieconverter_docker_image', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_mautrix_telegram_lottieconverter_docker_image_registry_prefix', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_mautrix_telegram_lottieconverter_docker_image_registry_prefix_upstream', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_mautrix_telegram_lottieconverter_docker_image_registry_prefix_upstream_default', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_mautrix_telegram_lottieconverter_docker_repo', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_mautrix_telegram_lottieconverter_docker_repo_version', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_mautrix_telegram_lottieconverter_docker_src_files_path', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_bridge_mautrix_telegram_lottieconverter_container_self_build', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_bridge_mautrix_telegram_lottieconverter_docker_image_name_prefix', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_bridge_mautrix_telegram_lottieconverter_docker_image', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_bridge_mautrix_telegram_lottieconverter_docker_image_registry_prefix', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_bridge_mautrix_telegram_lottieconverter_docker_image_registry_prefix_upstream', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_bridge_mautrix_telegram_lottieconverter_docker_image_registry_prefix_upstream_default', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_bridge_mautrix_telegram_lottieconverter_docker_repo', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_bridge_mautrix_telegram_lottieconverter_docker_repo_version', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_bridge_mautrix_telegram_lottieconverter_docker_src_files_path', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
# Even older aliases (no `_mautrix` infix):
- {'old': 'matrix_telegram_lottieconverter_container_image_self_build', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
- {'old': 'matrix_telegram_lottieconverter_container_image_self_build_mask_arch', 'new': '<removed (lottieconverter is now bundled into the mautrix-telegram image)>'}
@@ -87,15 +87,15 @@
You need to define a required configuration setting (`{{ item.name }}`).
when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
with_items:
- {'name': 'matrix_mautrix_telegram_api_id', when: true}
- {'name': 'matrix_mautrix_telegram_api_hash', when: true}
- {'name': 'matrix_mautrix_telegram_appservice_token', when: true}
- {'name': 'matrix_mautrix_telegram_homeserver_address', when: true}
- {'name': 'matrix_mautrix_telegram_homeserver_token', when: true}
- {'name': 'matrix_mautrix_telegram_container_network', when: true}
- {'name': 'matrix_mautrix_telegram_database_hostname', when: "{{ matrix_mautrix_telegram_database_engine == 'postgres' }}"}
- {'name': 'matrix_mautrix_telegram_metrics_proxying_hostname', when: "{{ matrix_mautrix_telegram_metrics_proxying_enabled }}"}
- {'name': 'matrix_mautrix_telegram_metrics_proxying_path_prefix', when: "{{ matrix_mautrix_telegram_metrics_proxying_enabled }}"}
- {'name': 'matrix_bridge_mautrix_telegram_api_id', when: true}
- {'name': 'matrix_bridge_mautrix_telegram_api_hash', when: true}
- {'name': 'matrix_bridge_mautrix_telegram_appservice_token', when: true}
- {'name': 'matrix_bridge_mautrix_telegram_homeserver_address', when: true}
- {'name': 'matrix_bridge_mautrix_telegram_homeserver_token', when: true}
- {'name': 'matrix_bridge_mautrix_telegram_container_network', when: true}
- {'name': 'matrix_bridge_mautrix_telegram_database_hostname', when: "{{ matrix_bridge_mautrix_telegram_database_engine == 'postgres' }}"}
- {'name': 'matrix_bridge_mautrix_telegram_metrics_proxying_hostname', when: "{{ matrix_bridge_mautrix_telegram_metrics_proxying_enabled }}"}
- {'name': 'matrix_bridge_mautrix_telegram_metrics_proxying_path_prefix', when: "{{ matrix_bridge_mautrix_telegram_metrics_proxying_enabled }}"}
# Temporary workaround for an upstream SQLite legacy-migration bug in mautrix-telegram v0.2604.0.
# See the separate task file for details; the whole file (and this include) can be deleted once
@@ -103,8 +103,8 @@
- name: Guard against the upstream mautrix-telegram v0.2604.0 SQLite legacy-migration bug
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config_sqlite_legacy_migration_bug.yml"
when:
- "matrix_mautrix_telegram_database_engine == 'sqlite'"
- "not (matrix_mautrix_telegram_bridgev2_sqlite_upgrade_confirmed | default(false) | bool)"
- "matrix_bridge_mautrix_telegram_database_engine == 'sqlite'"
- "not (matrix_bridge_mautrix_telegram_bridgev2_sqlite_upgrade_confirmed | default(false) | bool)"
# Bridgev2 permission values are: block, relay, commands, user, admin.
# The old Python bridge had different levels (relaybot, user, puppeting, full, admin).
@@ -112,8 +112,8 @@
# equivalent to the old `full`/`puppeting`). `relaybot`, `puppeting` and `full` don't exist
# in bridgev2 and will cause the bridge to reject its config at startup.
#
# We check the fully-merged configuration (not just `matrix_mautrix_telegram_bridge_permissions`)
# because users commonly override permissions via `matrix_mautrix_telegram_configuration_extension_yaml`,
# We check the fully-merged configuration (not just `matrix_bridge_mautrix_telegram_bridge_permissions`)
# because users commonly override permissions via `matrix_bridge_mautrix_telegram_configuration_extension_yaml`,
# and those overrides would otherwise slip through validation.
- name: Fail if bridge permissions still reference legacy Python-bridge permission levels
ansible.builtin.fail:
@@ -134,9 +134,9 @@
admin -> admin
See https://docs.mau.fi/bridges/general/permissions.html and the bridge's example config
for details. Update either `matrix_mautrix_telegram_bridge_permissions` or the `bridge.permissions`
section inside `matrix_mautrix_telegram_configuration_extension_yaml` — whichever you use.
for details. Update either `matrix_bridge_mautrix_telegram_bridge_permissions` or the `bridge.permissions`
section inside `matrix_bridge_mautrix_telegram_configuration_extension_yaml` — whichever you use.
when: "item.value in ['relaybot', 'puppeting', 'full']"
loop: "{{ (matrix_mautrix_telegram_configuration.bridge.permissions | default({})) | dict2items }}"
loop: "{{ (matrix_bridge_mautrix_telegram_configuration.bridge.permissions | default({})) | dict2items }}"
loop_control:
label: "{{ item.key }}"
@@ -24,18 +24,18 @@
# Telethon-session store, which upstream's legacymigrate.sql renames to
# `telethon_sessions_old` as part of the bridgev2 migration).
#
# Users can bypass this via `matrix_mautrix_telegram_bridgev2_sqlite_upgrade_confirmed: true`.
# Users can bypass this via `matrix_bridge_mautrix_telegram_bridgev2_sqlite_upgrade_confirmed: true`.
# ###########################################################################
- name: Check for an existing mautrix-telegram SQLite database (legacy location)
ansible.builtin.stat:
path: "{{ matrix_mautrix_telegram_base_path }}/mautrix-telegram.db"
register: matrix_mautrix_telegram_sqlite_legacy_path_stat
path: "{{ matrix_bridge_mautrix_telegram_base_path }}/mautrix-telegram.db"
register: matrix_bridge_mautrix_telegram_sqlite_legacy_path_stat
- name: Check for an existing mautrix-telegram SQLite database (data path)
ansible.builtin.stat:
path: "{{ matrix_mautrix_telegram_sqlite_database_path_local }}"
register: matrix_mautrix_telegram_sqlite_data_path_stat
path: "{{ matrix_bridge_mautrix_telegram_sqlite_database_path_local }}"
register: matrix_bridge_mautrix_telegram_sqlite_data_path_stat
- name: Inspect SQLite database for the legacy Python-bridge schema signature
ansible.builtin.command:
@@ -53,19 +53,19 @@
sys.exit(1 if cur.fetchone() else 0)
except Exception:
sys.exit(0)
- "{{ matrix_mautrix_telegram_sqlite_legacy_path_stat.stat.path if matrix_mautrix_telegram_sqlite_legacy_path_stat.stat.exists else matrix_mautrix_telegram_sqlite_data_path_stat.stat.path }}"
register: matrix_mautrix_telegram_sqlite_legacy_check
- "{{ matrix_bridge_mautrix_telegram_sqlite_legacy_path_stat.stat.path if matrix_bridge_mautrix_telegram_sqlite_legacy_path_stat.stat.exists else matrix_bridge_mautrix_telegram_sqlite_data_path_stat.stat.path }}"
register: matrix_bridge_mautrix_telegram_sqlite_legacy_check
changed_when: false
failed_when: false
when: >-
matrix_mautrix_telegram_sqlite_legacy_path_stat.stat.exists
or matrix_mautrix_telegram_sqlite_data_path_stat.stat.exists
matrix_bridge_mautrix_telegram_sqlite_legacy_path_stat.stat.exists
or matrix_bridge_mautrix_telegram_sqlite_data_path_stat.stat.exists
- name: Fail if upgrading a legacy SQLite install (upstream has a known migration bug)
ansible.builtin.fail:
msg: |-
A legacy Python mautrix-telegram SQLite database was detected at
`{{ matrix_mautrix_telegram_sqlite_legacy_path_stat.stat.path if matrix_mautrix_telegram_sqlite_legacy_path_stat.stat.exists else matrix_mautrix_telegram_sqlite_data_path_stat.stat.path }}`
`{{ matrix_bridge_mautrix_telegram_sqlite_legacy_path_stat.stat.path if matrix_bridge_mautrix_telegram_sqlite_legacy_path_stat.stat.exists else matrix_bridge_mautrix_telegram_sqlite_data_path_stat.stat.path }}`
(it contains the `telethon_sessions` table from the Python bridge).
Upstream mautrix-telegram v0.2604.0 has a **known bug** in the legacy SQLite
@@ -78,7 +78,7 @@
1. Switch to Postgres before upgrading. If you're using the playbook-managed Postgres
service (`postgres_enabled: true`), just set:
matrix_mautrix_telegram_database_engine: postgres
matrix_bridge_mautrix_telegram_database_engine: postgres
and re-run the playbook. The playbook will migrate your SQLite data into Postgres
first (via pgloader), and upstream's bridgev2 migration path is known to work on
@@ -90,10 +90,10 @@
If you're sure you want to proceed anyway (for example because you have a separate
backup), you can bypass this check by setting:
matrix_mautrix_telegram_bridgev2_sqlite_upgrade_confirmed: true
matrix_bridge_mautrix_telegram_bridgev2_sqlite_upgrade_confirmed: true
in your vars.yml. Only use the override if you know what you're doing.
when: >-
(matrix_mautrix_telegram_sqlite_legacy_path_stat.stat.exists
or matrix_mautrix_telegram_sqlite_data_path_stat.stat.exists)
and (matrix_mautrix_telegram_sqlite_legacy_check.rc | default(0)) == 1
(matrix_bridge_mautrix_telegram_sqlite_legacy_path_stat.stat.exists
or matrix_bridge_mautrix_telegram_sqlite_data_path_stat.stat.exists)
and (matrix_bridge_mautrix_telegram_sqlite_legacy_check.rc | default(0)) == 1