More ansible-lint fixes
This commit is contained in:
@ -8,24 +8,24 @@
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-mautrix-facebook.service'] }}"
|
||||
when: matrix_mautrix_facebook_enabled|bool
|
||||
when: matrix_mautrix_facebook_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_facebook_config_path }}/registration.yaml,dst=/matrix-mautrix-facebook-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-facebook-registration.yaml"]
|
||||
}}
|
||||
when: matrix_mautrix_facebook_enabled|bool
|
||||
when: matrix_mautrix_facebook_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-facebook role.
|
||||
when: matrix_nginx_proxy_role_executed|default(False)|bool
|
||||
when: matrix_nginx_proxy_role_executed | default(False) | bool
|
||||
|
||||
- name: Generate Mautrix Facebook proxying configuration for matrix-nginx-proxy
|
||||
ansible.builtin.set_fact:
|
||||
matrix_mautrix_facebook_matrix_nginx_proxy_configuration: |
|
||||
location {{ matrix_mautrix_facebook_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-facebook:29319";
|
||||
@ -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_facebook_matrix_nginx_proxy_configuration]
|
||||
}}
|
||||
@ -69,8 +69,8 @@
|
||||
Please make sure that you're proxying the `{{ matrix_mautrix_facebook_public_endpoint }}`
|
||||
URL endpoint to the matrix-mautrix-facebook container.
|
||||
You can expose the container's port using the `matrix_mautrix_facebook_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_facebook_enabled|bool and matrix_mautrix_facebook_appservice_public_enabled|bool
|
||||
when: matrix_mautrix_facebook_enabled | bool and matrix_mautrix_facebook_appservice_public_enabled | bool
|
||||
|
@ -1,23 +1,23 @@
|
||||
---
|
||||
|
||||
- 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_facebook_enabled|bool"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup | bool and matrix_mautrix_facebook_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-mautrix-facebook
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup|bool and matrix_mautrix_facebook_enabled|bool"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_mautrix_facebook_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-mautrix-facebook
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup|bool and not matrix_mautrix_facebook_enabled|bool"
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_mautrix_facebook_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-mautrix-facebook
|
||||
|
@ -6,14 +6,14 @@
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
The matrix-bridge-mautrix-facebook 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_facebook_requires_restart: false
|
||||
|
||||
- block:
|
||||
- name: Check if an SQLite database already exists
|
||||
stat:
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_mautrix_facebook_sqlite_database_path_local }}"
|
||||
register: matrix_mautrix_facebook_sqlite_database_path_local_stat_result
|
||||
|
||||
@ -22,16 +22,16 @@
|
||||
matrix_postgres_db_migration_request:
|
||||
src: "{{ matrix_mautrix_facebook_sqlite_database_path_local }}"
|
||||
dst: "{{ matrix_mautrix_facebook_database_connection_string }}"
|
||||
caller: "{{ role_path|basename }}"
|
||||
caller: "{{ role_path | basename }}"
|
||||
engine_variable_name: 'matrix_mautrix_facebook_database_engine'
|
||||
engine_old: 'sqlite'
|
||||
systemd_services_to_stop: ['matrix-mautrix-facebook.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_facebook_requires_restart: true
|
||||
when: "matrix_mautrix_facebook_sqlite_database_path_local_stat_result.stat.exists|bool"
|
||||
when: "matrix_mautrix_facebook_sqlite_database_path_local_stat_result.stat.exists | bool"
|
||||
when: "matrix_mautrix_facebook_database_engine == 'postgres'"
|
||||
|
||||
- name: Ensure Mautrix Facebook image is pulled
|
||||
@ -58,7 +58,7 @@
|
||||
- {path: "{{ matrix_mautrix_facebook_config_path }}", when: true}
|
||||
- {path: "{{ matrix_mautrix_facebook_data_path }}", when: true}
|
||||
- {path: "{{ matrix_mautrix_facebook_docker_src_files_path }}", when: "{{ matrix_mautrix_facebook_container_image_self_build }}"}
|
||||
when: item.when|bool
|
||||
when: item.when | bool
|
||||
|
||||
- name: Ensure Mautrix Facebook repository is present on self-build
|
||||
ansible.builtin.git:
|
||||
@ -69,7 +69,7 @@
|
||||
become: true
|
||||
become_user: "{{ matrix_user_username }}"
|
||||
register: matrix_mautrix_facebook_git_pull_results
|
||||
when: "matrix_mautrix_facebook_container_image_self_build|bool"
|
||||
when: "matrix_mautrix_facebook_container_image_self_build | bool"
|
||||
|
||||
- name: Ensure Mautrix Facebook Docker image is built
|
||||
docker_image:
|
||||
@ -81,10 +81,10 @@
|
||||
dockerfile: Dockerfile
|
||||
path: "{{ matrix_mautrix_facebook_docker_src_files_path }}"
|
||||
pull: true
|
||||
when: "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:
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_mautrix_facebook_base_path }}/mautrix-facebook.db"
|
||||
register: matrix_mautrix_facebook_stat_database
|
||||
|
||||
@ -103,7 +103,7 @@
|
||||
|
||||
- name: Ensure mautrix-facebook config.yaml installed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_mautrix_facebook_configuration|to_nice_yaml(indent=2, width=999999) }}"
|
||||
content: "{{ matrix_mautrix_facebook_configuration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_mautrix_facebook_config_path }}/config.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
@ -111,7 +111,7 @@
|
||||
|
||||
- name: Ensure mautrix-facebook registration.yaml installed
|
||||
ansible.builtin.copy:
|
||||
content: "{{ matrix_mautrix_facebook_registration|to_nice_yaml(indent=2, width=999999) }}"
|
||||
content: "{{ matrix_mautrix_facebook_registration | to_nice_yaml(indent=2, width=999999) }}"
|
||||
dest: "{{ matrix_mautrix_facebook_config_path }}/registration.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
@ -133,4 +133,4 @@
|
||||
ansible.builtin.service:
|
||||
name: "matrix-mautrix-facebook.service"
|
||||
state: restarted
|
||||
when: "matrix_mautrix_facebook_requires_restart|bool"
|
||||
when: "matrix_mautrix_facebook_requires_restart | bool"
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
|
||||
- name: Check existence of matrix-mautrix-facebook service
|
||||
stat:
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_systemd_path }}/matrix-mautrix-facebook.service"
|
||||
register: matrix_mautrix_facebook_service_stat
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
ansible.builtin.set_fact:
|
||||
matrix_playbook_runtime_results: |
|
||||
{{
|
||||
matrix_playbook_runtime_results|default([])
|
||||
matrix_playbook_runtime_results | default([])
|
||||
+
|
||||
[
|
||||
"NOTE: Your mautrix-facebook bridge is still on SQLite and on the last version that supported it, before support was dropped. Support has been subsequently re-added in v0.3.2, so we advise you to upgrade (by removing your `matrix_mautrix_facebook_docker_image` definition from vars.yml)"
|
||||
|
Reference in New Issue
Block a user