More ansible-lint fixes

This commit is contained in:
Slavi Pantaleev
2022-07-18 11:22:05 +03:00
parent 34cdaade08
commit ddf18eadc7
337 changed files with 1720 additions and 1720 deletions

View File

@ -99,11 +99,11 @@ matrix_mautrix_googlechat_configuration_extension_yaml: |
# If you need something more special, you can take full control by
# completely redefining `matrix_mautrix_googlechat_configuration_yaml`.
matrix_mautrix_googlechat_configuration_extension: "{{ matrix_mautrix_googlechat_configuration_extension_yaml|from_yaml if matrix_mautrix_googlechat_configuration_extension_yaml|from_yaml is mapping else {} }}"
matrix_mautrix_googlechat_configuration_extension: "{{ matrix_mautrix_googlechat_configuration_extension_yaml | from_yaml if matrix_mautrix_googlechat_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_googlechat_configuration_yaml`.
matrix_mautrix_googlechat_configuration: "{{ matrix_mautrix_googlechat_configuration_yaml|from_yaml|combine(matrix_mautrix_googlechat_configuration_extension, recursive=True) }}"
matrix_mautrix_googlechat_configuration: "{{ matrix_mautrix_googlechat_configuration_yaml | from_yaml|combine(matrix_mautrix_googlechat_configuration_extension, recursive=True) }}"
matrix_mautrix_googlechat_registration_yaml: |
id: googlechat
@ -121,4 +121,4 @@ matrix_mautrix_googlechat_registration_yaml: |
rate_limited: false
de.sorunome.msc2409.push_ephemeral: true
matrix_mautrix_googlechat_registration: "{{ matrix_mautrix_googlechat_registration_yaml|from_yaml }}"
matrix_mautrix_googlechat_registration: "{{ matrix_mautrix_googlechat_registration_yaml | from_yaml }}"

View File

@ -8,24 +8,24 @@
- ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-mautrix-googlechat.service'] }}"
when: matrix_mautrix_googlechat_enabled|bool
when: matrix_mautrix_googlechat_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_googlechat_config_path }}/registration.yaml,dst=/matrix-mautrix-googlechat-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-googlechat-registration.yaml"]
}}
when: matrix_mautrix_googlechat_enabled|bool
when: matrix_mautrix_googlechat_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-googlechat role.
when: matrix_nginx_proxy_role_executed|default(False)|bool
when: matrix_nginx_proxy_role_executed | default(False) | bool
- name: Generate Mautrix googlechat proxying configuration for matrix-nginx-proxy
ansible.builtin.set_fact:
matrix_mautrix_googlechat_matrix_nginx_proxy_configuration: |
location {{ matrix_mautrix_googlechat_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-googlechat:8080";
@ -55,13 +55,13 @@
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_googlechat_matrix_nginx_proxy_configuration]
}}
tags:
- always
when: matrix_mautrix_googlechat_enabled|bool
when: matrix_mautrix_googlechat_enabled | bool
- name: Warn about reverse-proxying if matrix-nginx-proxy not used
ansible.builtin.debug:
@ -71,4 +71,4 @@
Please make sure that you're proxying the `{{ matrix_mautrix_googlechat_public_endpoint }}`
URL endpoint to the matrix-mautrix-googlechat container.
You can expose the container's port using the `matrix_mautrix_googlechat_container_http_host_bind_port` variable.
when: "matrix_mautrix_googlechat_enabled|bool and not matrix_nginx_proxy_enabled|default(False)|bool"
when: "matrix_mautrix_googlechat_enabled | bool and not matrix_nginx_proxy_enabled | default(False) | bool"

View File

@ -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_googlechat_enabled|bool"
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup | bool and matrix_mautrix_googlechat_enabled | bool"
tags:
- setup-all
- setup-mautrix-googlechat
- import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup|bool and matrix_mautrix_googlechat_enabled|bool"
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup | bool and matrix_mautrix_googlechat_enabled | bool"
tags:
- setup-all
- setup-mautrix-googlechat
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup|bool and not matrix_mautrix_googlechat_enabled|bool"
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup | bool and not matrix_mautrix_googlechat_enabled | bool"
tags:
- setup-all
- setup-mautrix-googlechat

View File

@ -6,14 +6,14 @@
ansible.builtin.fail:
msg: >-
The matrix-bridge-mautrix-googlechat 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_googlechat_requires_restart: false
- block:
- name: Check if an SQLite database already exists
stat:
ansible.builtin.stat:
path: "{{ matrix_mautrix_googlechat_sqlite_database_path_local }}"
register: matrix_mautrix_googlechat_sqlite_database_path_local_stat_result
@ -22,16 +22,16 @@
matrix_postgres_db_migration_request:
src: "{{ matrix_mautrix_googlechat_sqlite_database_path_local }}"
dst: "{{ matrix_mautrix_googlechat_database_connection_string }}"
caller: "{{ role_path|basename }}"
caller: "{{ role_path | basename }}"
engine_variable_name: 'matrix_mautrix_googlechat_database_engine'
engine_old: 'sqlite'
systemd_services_to_stop: ['matrix-mautrix-googlechat.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_googlechat_requires_restart: true
when: "matrix_mautrix_googlechat_sqlite_database_path_local_stat_result.stat.exists|bool"
when: "matrix_mautrix_googlechat_sqlite_database_path_local_stat_result.stat.exists | bool"
when: "matrix_mautrix_googlechat_database_engine == 'postgres'"
- name: Ensure Mautrix googlechat image is pulled
@ -58,7 +58,7 @@
- {path: "{{ matrix_mautrix_googlechat_config_path }}", when: true}
- {path: "{{ matrix_mautrix_googlechat_data_path }}", when: true}
- {path: "{{ matrix_mautrix_googlechat_docker_src_files_path }}", when: "{{ matrix_mautrix_googlechat_container_image_self_build }}"}
when: "item.when|bool"
when: "item.when | bool"
- name: Ensure Mautrix Hangots repository is present on self build
ansible.builtin.git:
@ -68,7 +68,7 @@
become: true
become_user: "{{ matrix_user_username }}"
register: matrix_mautrix_googlechat_git_pull_results
when: "matrix_mautrix_googlechat_container_image_self_build|bool"
when: "matrix_mautrix_googlechat_container_image_self_build | bool"
- name: Ensure Mautrix googlechat Docker image is built
docker_image:
@ -80,10 +80,10 @@
dockerfile: Dockerfile
path: "{{ matrix_mautrix_googlechat_docker_src_files_path }}"
pull: true
when: "matrix_mautrix_googlechat_container_image_self_build|bool"
when: "matrix_mautrix_googlechat_container_image_self_build | bool"
- name: Check if an old database file already exists
stat:
ansible.builtin.stat:
path: "{{ matrix_mautrix_googlechat_base_path }}/mautrix-googlechat.db"
register: matrix_mautrix_googlechat_stat_database
@ -102,7 +102,7 @@
- name: Ensure mautrix-googlechat config.yaml installed
ansible.builtin.copy:
content: "{{ matrix_mautrix_googlechat_configuration|to_nice_yaml(indent=2, width=999999) }}"
content: "{{ matrix_mautrix_googlechat_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_mautrix_googlechat_config_path }}/config.yaml"
mode: 0644
owner: "{{ matrix_user_username }}"
@ -110,7 +110,7 @@
- name: Ensure mautrix-googlechat registration.yaml installed
ansible.builtin.copy:
content: "{{ matrix_mautrix_googlechat_registration|to_nice_yaml(indent=2, width=999999) }}"
content: "{{ matrix_mautrix_googlechat_registration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_mautrix_googlechat_config_path }}/registration.yaml"
mode: 0644
owner: "{{ matrix_user_username }}"
@ -132,4 +132,4 @@
ansible.builtin.service:
name: "matrix-mautrix-googlechat.service"
state: restarted
when: "matrix_mautrix_googlechat_requires_restart|bool"
when: "matrix_mautrix_googlechat_requires_restart | bool"

View File

@ -1,7 +1,7 @@
---
- name: Check existence of matrix-mautrix-googlechat service
stat:
ansible.builtin.stat:
path: "{{ matrix_systemd_path }}/matrix-mautrix-googlechat.service"
register: matrix_mautrix_googlechat_service_stat