More ansible-lint fixes
This commit is contained in:
@ -117,11 +117,11 @@ matrix_mautrix_telegram_configuration_extension_yaml: |
|
||||
# If you need something more special, you can take full control by
|
||||
# completely redefining `matrix_mautrix_telegram_configuration_yaml`.
|
||||
|
||||
matrix_mautrix_telegram_configuration_extension: "{{ matrix_mautrix_telegram_configuration_extension_yaml|from_yaml if matrix_mautrix_telegram_configuration_extension_yaml|from_yaml is mapping else {} }}"
|
||||
matrix_mautrix_telegram_configuration_extension: "{{ matrix_mautrix_telegram_configuration_extension_yaml | from_yaml if matrix_mautrix_telegram_configuration_extension_yaml | from_yaml is mapping else {} }}"
|
||||
|
||||
# Holds the final configuration (a combination of the default and its extension).
|
||||
# You most likely don't need to touch this variable. Instead, see `matrix_mautrix_telegram_configuration_yaml`.
|
||||
matrix_mautrix_telegram_configuration: "{{ matrix_mautrix_telegram_configuration_yaml|from_yaml|combine(matrix_mautrix_telegram_configuration_extension, recursive=True) }}"
|
||||
matrix_mautrix_telegram_configuration: "{{ matrix_mautrix_telegram_configuration_yaml | from_yaml|combine(matrix_mautrix_telegram_configuration_extension, recursive=True) }}"
|
||||
|
||||
matrix_mautrix_telegram_registration_yaml: |
|
||||
id: telegram
|
||||
@ -142,7 +142,7 @@ matrix_mautrix_telegram_registration_yaml: |
|
||||
rate_limited: false
|
||||
de.sorunome.msc2409.push_ephemeral: true
|
||||
|
||||
matrix_mautrix_telegram_registration: "{{ matrix_mautrix_telegram_registration_yaml|from_yaml }}"
|
||||
matrix_mautrix_telegram_registration: "{{ matrix_mautrix_telegram_registration_yaml | from_yaml }}"
|
||||
|
||||
# Templates for defining MXID's and displaynames for users and rooms.
|
||||
matrix_mautrix_telegram_username_template: 'telegram_{userid}'
|
||||
|
@ -8,24 +8,24 @@
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-mautrix-telegram.service'] }}"
|
||||
when: matrix_mautrix_telegram_enabled|bool
|
||||
when: matrix_mautrix_telegram_enabled | bool
|
||||
|
||||
# If the matrix-synapse role is not used, these variables may not exist.
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_synapse_container_extra_arguments: >
|
||||
{{
|
||||
matrix_synapse_container_extra_arguments|default([])
|
||||
matrix_synapse_container_extra_arguments | default([])
|
||||
+
|
||||
["--mount type=bind,src={{ matrix_mautrix_telegram_config_path }}/registration.yaml,dst=/matrix-mautrix-telegram-registration.yaml,ro"]
|
||||
}}
|
||||
|
||||
matrix_synapse_app_service_config_files: >
|
||||
{{
|
||||
matrix_synapse_app_service_config_files|default([])
|
||||
matrix_synapse_app_service_config_files | default([])
|
||||
+
|
||||
["/matrix-mautrix-telegram-registration.yaml"]
|
||||
}}
|
||||
when: matrix_mautrix_telegram_enabled|bool
|
||||
when: matrix_mautrix_telegram_enabled | bool
|
||||
|
||||
- block:
|
||||
- name: Fail if matrix-nginx-proxy role already executed
|
||||
@ -35,13 +35,13 @@
|
||||
but it's pointless since the matrix-nginx-proxy role had already executed.
|
||||
To fix this, please change the order of roles in your playbook,
|
||||
so that the matrix-nginx-proxy role would run after the matrix-bridge-mautrix-telegram role.
|
||||
when: matrix_nginx_proxy_role_executed|default(False)|bool
|
||||
when: matrix_nginx_proxy_role_executed | default(False) | bool
|
||||
|
||||
- name: Generate Mautrix Telegram proxying configuration for matrix-nginx-proxy
|
||||
ansible.builtin.set_fact:
|
||||
matrix_mautrix_telegram_matrix_nginx_proxy_configuration: |
|
||||
location {{ matrix_mautrix_telegram_public_endpoint }} {
|
||||
{% if matrix_nginx_proxy_enabled|default(False) %}
|
||||
{% if matrix_nginx_proxy_enabled | default(False) %}
|
||||
{# Use the embedded DNS resolver in Docker containers to discover the service #}
|
||||
resolver 127.0.0.11 valid=5s;
|
||||
set $backend "matrix-mautrix-telegram:8080";
|
||||
@ -56,7 +56,7 @@
|
||||
ansible.builtin.set_fact:
|
||||
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: |
|
||||
{{
|
||||
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks|default([])
|
||||
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks | default([])
|
||||
+
|
||||
[matrix_mautrix_telegram_matrix_nginx_proxy_configuration]
|
||||
}}
|
||||
@ -68,8 +68,8 @@
|
||||
Please make sure that you're proxying the `{{ matrix_mautrix_telegram_public_endpoint }}`
|
||||
URL endpoint to the matrix-mautrix-telegram container.
|
||||
You can expose the container's port using the `matrix_mautrix_telegram_container_http_host_bind_port` variable.
|
||||
when: "not matrix_nginx_proxy_enabled|default(False)|bool"
|
||||
when: "not matrix_nginx_proxy_enabled | default(False) | bool"
|
||||
|
||||
tags:
|
||||
- always
|
||||
when: matrix_mautrix_telegram_enabled|bool and matrix_mautrix_telegram_appservice_public_enabled|bool
|
||||
when: matrix_mautrix_telegram_enabled | bool and matrix_mautrix_telegram_appservice_public_enabled | bool
|
||||
|
@ -1,22 +1,22 @@
|
||||
---
|
||||
- import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup|bool and matrix_mautrix_telegram_enabled|bool"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup | bool and matrix_mautrix_telegram_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-mautrix-telegram
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup|bool and matrix_mautrix_telegram_enabled|bool"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_mautrix_telegram_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-mautrix-telegram
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup|bool and not matrix_mautrix_telegram_enabled|bool"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_mautrix_telegram_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-mautrix-telegram
|
||||
|
@ -6,14 +6,14 @@
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
The matrix-bridge-mautrix-telegram role needs to execute before the matrix-synapse role.
|
||||
when: "matrix_synapse_role_executed|default(False)"
|
||||
when: "matrix_synapse_role_executed | default(False)"
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_mautrix_telegram_requires_restart: false
|
||||
|
||||
- block:
|
||||
- name: Check if an SQLite database already exists
|
||||
stat:
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_mautrix_telegram_sqlite_database_path_local }}"
|
||||
register: matrix_mautrix_telegram_sqlite_database_path_local_stat_result
|
||||
|
||||
@ -22,16 +22,16 @@
|
||||
matrix_postgres_db_migration_request:
|
||||
src: "{{ matrix_mautrix_telegram_sqlite_database_path_local }}"
|
||||
dst: "{{ matrix_mautrix_telegram_database_connection_string }}"
|
||||
caller: "{{ role_path|basename }}"
|
||||
caller: "{{ role_path | basename }}"
|
||||
engine_variable_name: 'matrix_mautrix_telegram_database_engine'
|
||||
engine_old: 'sqlite'
|
||||
systemd_services_to_stop: ['matrix-mautrix-telegram.service']
|
||||
|
||||
- import_tasks: "{{ role_path }}/../matrix-postgres/tasks/util/migrate_db_to_postgres.yml"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/../matrix-postgres/tasks/util/migrate_db_to_postgres.yml"
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_mautrix_telegram_requires_restart: true
|
||||
when: "matrix_mautrix_telegram_sqlite_database_path_local_stat_result.stat.exists|bool"
|
||||
when: "matrix_mautrix_telegram_sqlite_database_path_local_stat_result.stat.exists | bool"
|
||||
when: "matrix_mautrix_telegram_database_engine == 'postgres'"
|
||||
|
||||
- name: Ensure Mautrix Telegram paths exist
|
||||
@ -46,7 +46,7 @@
|
||||
- {path: "{{ matrix_mautrix_telegram_config_path }}", when: true}
|
||||
- {path: "{{ matrix_mautrix_telegram_data_path }}", when: true}
|
||||
- {path: "{{ matrix_mautrix_telegram_docker_src_files_path }}", when: "{{ matrix_mautrix_telegram_container_image_self_build }}"}
|
||||
when: item.when|bool
|
||||
when: item.when | bool
|
||||
|
||||
- name: Ensure Mautrix Telegram image is pulled
|
||||
docker_image:
|
||||
@ -54,7 +54,7 @@
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_mautrix_telegram_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_telegram_docker_image_force_pull }}"
|
||||
when: "not matrix_mautrix_telegram_container_image_self_build|bool"
|
||||
when: "not matrix_mautrix_telegram_container_image_self_build | bool"
|
||||
register: result
|
||||
retries: "{{ matrix_container_retries_count }}"
|
||||
delay: "{{ matrix_container_retries_delay }}"
|
||||
@ -68,7 +68,7 @@
|
||||
become: true
|
||||
become_user: "{{ matrix_user_username }}"
|
||||
register: matrix_telegram_lottieconverter_git_pull_results
|
||||
when: "matrix_telegram_lottieconverter_container_image_self_build|bool and matrix_mautrix_telegram_container_image_self_build|bool"
|
||||
when: "matrix_telegram_lottieconverter_container_image_self_build | bool and matrix_mautrix_telegram_container_image_self_build | bool"
|
||||
|
||||
- name: Ensure lottieconverter Docker image is built
|
||||
docker_image:
|
||||
@ -80,7 +80,7 @@
|
||||
dockerfile: Dockerfile
|
||||
path: "{{ matrix_telegram_lottieconverter_docker_src_files_path }}"
|
||||
pull: true
|
||||
when: "matrix_telegram_lottieconverter_container_image_self_build|bool and matrix_telegram_lottieconverter_git_pull_results.changed and matrix_mautrix_telegram_container_image_self_build|bool"
|
||||
when: "matrix_telegram_lottieconverter_container_image_self_build | bool and matrix_telegram_lottieconverter_git_pull_results.changed and matrix_mautrix_telegram_container_image_self_build | bool"
|
||||
|
||||
- name: Ensure matrix-mautrix-telegram repository is present when self-building
|
||||
ansible.builtin.git:
|
||||
@ -90,7 +90,7 @@
|
||||
become: true
|
||||
become_user: "{{ matrix_user_username }}"
|
||||
register: matrix_mautrix_telegram_git_pull_results
|
||||
when: "matrix_mautrix_telegram_container_image_self_build|bool"
|
||||
when: "matrix_mautrix_telegram_container_image_self_build | bool"
|
||||
|
||||
- name: Ensure matrix-mautrix-telegram Docker image is built
|
||||
docker_image:
|
||||
@ -101,13 +101,13 @@
|
||||
build:
|
||||
dockerfile: Dockerfile
|
||||
path: "{{ matrix_mautrix_telegram_docker_src_files_path }}"
|
||||
pull: "{{ not matrix_telegram_lottieconverter_container_image_self_build_mask_arch|bool }}"
|
||||
pull: "{{ not matrix_telegram_lottieconverter_container_image_self_build_mask_arch | bool }}"
|
||||
args:
|
||||
TARGETARCH: ""
|
||||
when: "matrix_mautrix_telegram_container_image_self_build|bool and matrix_mautrix_telegram_git_pull_results.changed"
|
||||
when: "matrix_mautrix_telegram_container_image_self_build | bool and matrix_mautrix_telegram_git_pull_results.changed"
|
||||
|
||||
- name: Check if an old database file already exists
|
||||
stat:
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_mautrix_telegram_base_path }}/mautrix-telegram.db"
|
||||
register: matrix_mautrix_telegram_stat_database
|
||||
|
||||
@ -126,7 +126,7 @@
|
||||
|
||||
- name: Ensure mautrix-telegram config.yaml installed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_mautrix_telegram_configuration|to_nice_yaml(indent=2, width=999999) }}"
|
||||
content: "{{ matrix_mautrix_telegram_configuration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_mautrix_telegram_config_path }}/config.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
@ -134,7 +134,7 @@
|
||||
|
||||
- name: Ensure mautrix-telegram registration.yaml installed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_mautrix_telegram_registration|to_nice_yaml(indent=2, width=999999) }}"
|
||||
content: "{{ matrix_mautrix_telegram_registration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_mautrix_telegram_config_path }}/registration.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
@ -156,4 +156,4 @@
|
||||
ansible.builtin.service:
|
||||
name: "matrix-mautrix-telegram.service"
|
||||
state: restarted
|
||||
when: "matrix_mautrix_telegram_requires_restart|bool"
|
||||
when: "matrix_mautrix_telegram_requires_restart | bool"
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
|
||||
- name: Check existence of matrix-mautrix-telegram service
|
||||
stat:
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_systemd_path }}/matrix-mautrix-telegram.service"
|
||||
register: matrix_mautrix_telegram_service_stat
|
||||
|
||||
|
Reference in New Issue
Block a user