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

@ -1,7 +1,7 @@
--- ---
- import_tasks: "{{ role_path }}/tasks/setup.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup.yml"
when: run_stop|bool when: run_stop | bool
tags: tags:
- setup-all - setup-all
- setup-aux-files - setup-aux-files

View file

@ -4,16 +4,16 @@
ansible.builtin.file: ansible.builtin.file:
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
state: directory state: directory
owner: "{{ item.owner|default(matrix_user_username) }}" owner: "{{ item.owner | default(matrix_user_username) }}"
group: "{{ item.group|default(matrix_user_groupname) }}" group: "{{ item.group | default(matrix_user_groupname) }}"
mode: "{{ item.mode|default(matrix_aux_directory_default_mode) }}" mode: "{{ item.mode | default(matrix_aux_directory_default_mode) }}"
with_items: "{{ matrix_aux_directory_definitions }}" with_items: "{{ matrix_aux_directory_definitions }}"
- name: Ensure AUX files are created - name: Ensure AUX files are created
ansible.builtin.copy: ansible.builtin.copy:
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
content: "{{ item.content }}" content: "{{ item.content }}"
owner: "{{ item.owner|default(matrix_user_username) }}" owner: "{{ item.owner | default(matrix_user_username) }}"
group: "{{ item.group|default(matrix_user_groupname) }}" group: "{{ item.group | default(matrix_user_groupname) }}"
mode: "{{ item.mode|default(matrix_aux_file_default_mode) }}" mode: "{{ item.mode | default(matrix_aux_file_default_mode) }}"
with_items: "{{ matrix_aux_file_definitions }}" with_items: "{{ matrix_aux_file_definitions }}"

View file

@ -14,7 +14,7 @@ matrix_backup_borg_docker_src_files_path: "{{ matrix_backup_borg_base_path }}/do
matrix_backup_borg_version: "" matrix_backup_borg_version: ""
matrix_backup_borg_docker_image: "{{ matrix_backup_borg_docker_image_name_prefix }}etke.cc/borgmatic:{{ matrix_backup_borg_version }}" matrix_backup_borg_docker_image: "{{ matrix_backup_borg_docker_image_name_prefix }}etke.cc/borgmatic:{{ matrix_backup_borg_version }}"
matrix_backup_borg_docker_image_name_prefix: "{{ 'localhost/' if matrix_backup_borg_container_image_self_build else 'registry.gitlab.com/' }}" matrix_backup_borg_docker_image_name_prefix: "{{ 'localhost/' if matrix_backup_borg_container_image_self_build else 'registry.gitlab.com/' }}"
matrix_backup_borg_docker_image_force_pull: "{{ matrix_backup_borg_docker_image.endswith(':latest') or matrix_backup_borg_version|default('') == '' }}" matrix_backup_borg_docker_image_force_pull: "{{ matrix_backup_borg_docker_image.endswith(':latest') or matrix_backup_borg_version | default('') == '' }}"
# A list of extra arguments to pass to the container # A list of extra arguments to pass to the container
matrix_backup_borg_container_extra_arguments: [] matrix_backup_borg_container_extra_arguments: []
@ -93,8 +93,8 @@ matrix_backup_borg_configuration_extension_yaml: |
# If you need something more special, you can take full control by # If you need something more special, you can take full control by
# completely redefining `matrix_backup_borg_configuration_yaml`. # completely redefining `matrix_backup_borg_configuration_yaml`.
matrix_backup_borg_configuration_extension: "{{ matrix_backup_borg_configuration_extension_yaml|from_yaml if matrix_backup_borg_configuration_extension_yaml|from_yaml is mapping else {} }}" matrix_backup_borg_configuration_extension: "{{ matrix_backup_borg_configuration_extension_yaml | from_yaml if matrix_backup_borg_configuration_extension_yaml | from_yaml is mapping else {} }}"
# Holds the final borgmatic configuration (a combination of the default and its extension). # Holds the final borgmatic configuration (a combination of the default and its extension).
# You most likely don't need to touch this variable. Instead, see `matrix_backup_borg_configuration_yaml`. # You most likely don't need to touch this variable. Instead, see `matrix_backup_borg_configuration_yaml`.
matrix_backup_borg_configuration: "{{ matrix_backup_borg_configuration_yaml|from_yaml|combine(matrix_backup_borg_configuration_extension, recursive=True) }}" matrix_backup_borg_configuration: "{{ matrix_backup_borg_configuration_yaml | from_yaml|combine(matrix_backup_borg_configuration_extension, recursive=True) }}"

View file

@ -1,4 +1,4 @@
--- ---
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-backup-borg.timer'] }}" matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-backup-borg.timer'] }}"
when: matrix_backup_borg_enabled|bool when: matrix_backup_borg_enabled | bool

View file

@ -1,23 +1,23 @@
--- ---
- import_tasks: "{{ role_path }}/tasks/init.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
tags: tags:
- always - always
- import_tasks: "{{ role_path }}/tasks/validate_config.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup|bool and matrix_backup_borg_enabled|bool" when: "run_setup | bool and matrix_backup_borg_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-backup-borg - setup-backup-borg
- import_tasks: "{{ role_path }}/tasks/setup_install.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup|bool and matrix_backup_borg_enabled|bool" when: "run_setup | bool and matrix_backup_borg_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-backup-borg - setup-backup-borg
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup|bool and not matrix_backup_borg_enabled|bool" when: "run_setup | bool and not matrix_backup_borg_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-backup-borg - setup-backup-borg

View file

@ -1,6 +1,6 @@
--- ---
- block: - block:
- import_tasks: "{{ role_path }}/../matrix-postgres/tasks/util/detect_existing_postgres_version.yml" - ansible.builtin.import_tasks: "{{ role_path }}/../matrix-postgres/tasks/util/detect_existing_postgres_version.yml"
- name: Fail if detected Postgres version is unsupported - name: Fail if detected Postgres version is unsupported
ansible.builtin.fail: ansible.builtin.fail:
@ -10,7 +10,7 @@
- name: Set the correct borg backup version to use - name: Set the correct borg backup version to use
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_backup_borg_version: "{{ matrix_postgres_detected_version }}" matrix_backup_borg_version: "{{ matrix_postgres_detected_version }}"
when: matrix_backup_borg_postgresql_enabled|bool and matrix_backup_borg_version == '' when: matrix_backup_borg_postgresql_enabled | bool and matrix_backup_borg_version == ''
- name: Ensure borg paths exist - name: Ensure borg paths exist
ansible.builtin.file: ansible.builtin.file:
@ -22,11 +22,11 @@
with_items: with_items:
- {path: "{{ matrix_backup_borg_config_path }}", when: true} - {path: "{{ matrix_backup_borg_config_path }}", when: true}
- {path: "{{ matrix_backup_borg_docker_src_files_path }}", when: true} - {path: "{{ matrix_backup_borg_docker_src_files_path }}", when: true}
when: "item.when|bool" when: "item.when | bool"
- name: Ensure borgmatic config is created - name: Ensure borgmatic config is created
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_backup_borg_configuration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_backup_borg_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_backup_borg_config_path }}/config.yaml" dest: "{{ matrix_backup_borg_config_path }}/config.yaml"
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}" group: "{{ matrix_user_groupname }}"
@ -54,7 +54,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_backup_borg_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" force_source: "{{ matrix_backup_borg_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_backup_borg_docker_image_force_pull }}" force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_backup_borg_docker_image_force_pull }}"
when: "not matrix_backup_borg_container_image_self_build|bool" when: "not matrix_backup_borg_container_image_self_build | bool"
register: result register: result
retries: "{{ matrix_container_retries_count }}" retries: "{{ matrix_container_retries_count }}"
delay: "{{ matrix_container_retries_delay }}" delay: "{{ matrix_container_retries_delay }}"
@ -68,7 +68,7 @@
become: true become: true
become_user: "{{ matrix_user_username }}" become_user: "{{ matrix_user_username }}"
register: matrix_backup_borg_git_pull_results register: matrix_backup_borg_git_pull_results
when: "matrix_backup_borg_container_image_self_build|bool" when: "matrix_backup_borg_container_image_self_build | bool"
- name: Ensure borg image is built - name: Ensure borg image is built
docker_image: docker_image:
@ -80,7 +80,7 @@
dockerfile: Dockerfile dockerfile: Dockerfile
path: "{{ matrix_backup_borg_docker_src_files_path }}" path: "{{ matrix_backup_borg_docker_src_files_path }}"
pull: true pull: true
when: "matrix_backup_borg_container_image_self_build|bool" when: "matrix_backup_borg_container_image_self_build | bool"
- name: Ensure matrix-backup-borg.service installed - name: Ensure matrix-backup-borg.service installed
ansible.builtin.template: ansible.builtin.template:
@ -99,7 +99,7 @@
- name: Ensure systemd reloaded after matrix-backup-borg.service installation - name: Ensure systemd reloaded after matrix-backup-borg.service installation
ansible.builtin.service: ansible.builtin.service:
daemon_reload: true daemon_reload: true
when: "matrix_backup_borg_systemd_service_result.changed|bool" when: "matrix_backup_borg_systemd_service_result.changed | bool"
- name: Ensure matrix-backup-borg.service enabled - name: Ensure matrix-backup-borg.service enabled
ansible.builtin.service: ansible.builtin.service:

View file

@ -1,6 +1,6 @@
--- ---
- name: Check existence of matrix-backup-borg service - name: Check existence of matrix-backup-borg service
stat: ansible.builtin.stat:
path: "{{ matrix_systemd_path }}/matrix-backup-borg.service" path: "{{ matrix_systemd_path }}/matrix-backup-borg.service"
register: matrix_backup_borg_service_stat register: matrix_backup_borg_service_stat
@ -11,24 +11,24 @@
enabled: false enabled: false
daemon_reload: true daemon_reload: true
register: stopping_result register: stopping_result
when: "matrix_backup_borg_service_stat.stat.exists|bool" when: "matrix_backup_borg_service_stat.stat.exists | bool"
- name: Ensure matrix-backup-borg.service doesn't exist - name: Ensure matrix-backup-borg.service doesn't exist
ansible.builtin.file: ansible.builtin.file:
path: "{{ matrix_systemd_path }}/matrix-backup-borg.service" path: "{{ matrix_systemd_path }}/matrix-backup-borg.service"
state: absent state: absent
when: "matrix_backup_borg_service_stat.stat.exists|bool" when: "matrix_backup_borg_service_stat.stat.exists | bool"
- name: Ensure matrix-backup-borg.timer doesn't exist - name: Ensure matrix-backup-borg.timer doesn't exist
ansible.builtin.file: ansible.builtin.file:
path: "{{ matrix_systemd_path }}/matrix-backup-borg.timer" path: "{{ matrix_systemd_path }}/matrix-backup-borg.timer"
state: absent state: absent
when: "matrix_backup_borg_service_stat.stat.exists|bool" when: "matrix_backup_borg_service_stat.stat.exists | bool"
- name: Ensure systemd reloaded after matrix-backup-borg.service removal - name: Ensure systemd reloaded after matrix-backup-borg.service removal
ansible.builtin.service: ansible.builtin.service:
daemon_reload: true daemon_reload: true
when: "matrix_backup_borg_service_stat.stat.exists|bool" when: "matrix_backup_borg_service_stat.stat.exists | bool"
- name: Ensure Matrix borg paths don't exist - name: Ensure Matrix borg paths don't exist
ansible.builtin.file: ansible.builtin.file:

View file

@ -1,34 +1,34 @@
--- ---
- import_tasks: "{{ role_path }}/tasks/sanity_check.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/sanity_check.yml"
tags: tags:
- always - always
- import_tasks: "{{ role_path }}/tasks/clean_up_old_files.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/clean_up_old_files.yml"
when: run_setup|bool when: run_setup | bool
tags: tags:
- setup-all - setup-all
- import_tasks: "{{ role_path }}/tasks/server_base/setup.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/server_base/setup.yml"
when: run_setup|bool when: run_setup | bool
tags: tags:
- setup-all - setup-all
# This needs to always run, because it populates `matrix_user_uid` and `matrix_user_gid`, # This needs to always run, because it populates `matrix_user_uid` and `matrix_user_gid`,
# which are required by many other roles. # which are required by many other roles.
- import_tasks: "{{ role_path }}/tasks/setup_matrix_user.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_matrix_user.yml"
when: run_setup|bool when: run_setup | bool
tags: tags:
- always - always
- setup-system-user - setup-system-user
- import_tasks: "{{ role_path }}/tasks/setup_matrix_base.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_matrix_base.yml"
when: run_setup|bool when: run_setup | bool
tags: tags:
- setup-all - setup-all
- import_tasks: "{{ role_path }}/tasks/setup_well_known.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_well_known.yml"
when: run_setup|bool when: run_setup | bool
tags: tags:
- setup-all - setup-all
- setup-ma1sd - setup-ma1sd

View file

@ -50,11 +50,11 @@
ansible.builtin.fail: ansible.builtin.fail:
msg: "The `{{ item.var }}` variable must be defined and have a non-null and non-empty value" msg: "The `{{ item.var }}` variable must be defined and have a non-null and non-empty value"
with_items: with_items:
- {'var': matrix_domain, 'value': "{{ matrix_domain|default('') }}"} - {'var': matrix_domain, 'value': "{{ matrix_domain | default('') }}"}
- {'var': matrix_server_fqn_matrix, 'value': "{{ matrix_server_fqn_matrix|default('') }}"} - {'var': matrix_server_fqn_matrix, 'value': "{{ matrix_server_fqn_matrix | default('') }}"}
- {'var': matrix_server_fqn_element, 'value': "{{ matrix_server_fqn_element|default('') }}"} - {'var': matrix_server_fqn_element, 'value': "{{ matrix_server_fqn_element | default('') }}"}
- {'var': matrix_homeserver_container_url, 'value': "{{ matrix_homeserver_container_url|default('') }}"} - {'var': matrix_homeserver_container_url, 'value': "{{ matrix_homeserver_container_url | default('') }}"}
- {'var': matrix_homeserver_container_federation_url, 'value': "{{ matrix_homeserver_container_federation_url|default('') }}"} - {'var': matrix_homeserver_container_federation_url, 'value': "{{ matrix_homeserver_container_federation_url | default('') }}"}
when: "item.value is none or item.value == ''" when: "item.value is none or item.value == ''"
- name: Fail if uppercase domain used - name: Fail if uppercase domain used

View file

@ -1,12 +1,12 @@
--- ---
- include_tasks: "{{ role_path }}/tasks/server_base/setup_redhat.yml" - ansible.builtin.include_tasks: "{{ role_path }}/tasks/server_base/setup_redhat.yml"
when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int < 8 when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int < 8
- include_tasks: "{{ role_path }}/tasks/server_base/setup_redhat8.yml" - ansible.builtin.include_tasks: "{{ role_path }}/tasks/server_base/setup_redhat8.yml"
when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int > 7 and ansible_distribution_major_version|int < 30 when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int > 7 and ansible_distribution_major_version|int < 30
- include_tasks: "{{ role_path }}/tasks/server_base/setup_fedora.yml" - ansible.builtin.include_tasks: "{{ role_path }}/tasks/server_base/setup_fedora.yml"
when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int > 30 when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int > 30
- block: - block:
@ -23,14 +23,14 @@
setup: filter=ansible_lsb* setup: filter=ansible_lsb*
when: lsb_release_installation_result.changed when: lsb_release_installation_result.changed
- include_tasks: "{{ role_path }}/tasks/server_base/setup_debian.yml" - ansible.builtin.include_tasks: "{{ role_path }}/tasks/server_base/setup_debian.yml"
when: (ansible_os_family == 'Debian') and (ansible_lsb.id != 'Raspbian') when: (ansible_os_family == 'Debian') and (ansible_lsb.id != 'Raspbian')
- include_tasks: "{{ role_path }}/tasks/server_base/setup_raspbian.yml" - ansible.builtin.include_tasks: "{{ role_path }}/tasks/server_base/setup_raspbian.yml"
when: (ansible_os_family == 'Debian') and (ansible_lsb.id == 'Raspbian') when: (ansible_os_family == 'Debian') and (ansible_lsb.id == 'Raspbian')
when: ansible_os_family == 'Debian' when: ansible_os_family == 'Debian'
- include_tasks: "{{ role_path }}/tasks/server_base/setup_archlinux.yml" - ansible.builtin.include_tasks: "{{ role_path }}/tasks/server_base/setup_archlinux.yml"
when: ansible_distribution == 'Archlinux' when: ansible_distribution == 'Archlinux'
- name: Ensure Docker is started and autoruns - name: Ensure Docker is started and autoruns

View file

@ -13,4 +13,4 @@
name: name:
- docker - docker
state: latest state: latest
when: matrix_docker_installation_enabled|bool when: matrix_docker_installation_enabled | bool

View file

@ -16,14 +16,14 @@
state: present state: present
register: add_repository_key register: add_repository_key
ignore_errors: true ignore_errors: true
when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce' when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure Docker repository is enabled - name: Ensure Docker repository is enabled
apt_repository: apt_repository:
repo: "deb [arch={{ matrix_debian_arch }}] https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} stable" repo: "deb [arch={{ matrix_debian_arch }}] https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} stable"
state: present state: present
update_cache: true update_cache: true
when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce' when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure APT packages are installed - name: Ensure APT packages are installed
ansible.builtin.apt: ansible.builtin.apt:
@ -38,4 +38,4 @@
- "{{ matrix_docker_package_name }}" - "{{ matrix_docker_package_name }}"
- "python{{'3' if ansible_python.version.major == 3 else ''}}-docker" - "python{{'3' if ansible_python.version.major == 3 else ''}}-docker"
state: latest state: latest
when: matrix_docker_installation_enabled|bool when: matrix_docker_installation_enabled | bool

View file

@ -9,13 +9,13 @@
mode: 0644 mode: 0644
with_items: with_items:
- docker-ce-fedora.repo - docker-ce-fedora.repo
when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce' when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure Docker's RPM key is trusted - name: Ensure Docker's RPM key is trusted
rpm_key: rpm_key:
state: present state: present
key: https://download.docker.com/linux/fedora/gpg key: https://download.docker.com/linux/fedora/gpg
when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce' when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure yum packages are installed - name: Ensure yum packages are installed
ansible.builtin.yum: ansible.builtin.yum:
@ -30,10 +30,10 @@
- "{{ matrix_docker_package_name }}" - "{{ matrix_docker_package_name }}"
- python3-pip - python3-pip
state: latest state: latest
when: matrix_docker_installation_enabled|bool when: matrix_docker_installation_enabled | bool
- name: Ensure Docker-Py is installed - name: Ensure Docker-Py is installed
pip: pip:
name: docker-py name: docker-py
state: latest state: latest
when: matrix_docker_installation_enabled|bool when: matrix_docker_installation_enabled | bool

View file

@ -16,14 +16,14 @@
state: present state: present
register: add_repository_key register: add_repository_key
ignore_errors: true ignore_errors: true
when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce' when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure Docker repository is enabled - name: Ensure Docker repository is enabled
apt_repository: apt_repository:
repo: "deb [arch={{ matrix_debian_arch }}] https://download.docker.com/linux/raspbian {{ ansible_distribution_release }} stable" repo: "deb [arch={{ matrix_debian_arch }}] https://download.docker.com/linux/raspbian {{ ansible_distribution_release }} stable"
state: present state: present
update_cache: true update_cache: true
when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce' when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure APT packages are installed - name: Ensure APT packages are installed
ansible.builtin.apt: ansible.builtin.apt:
@ -38,4 +38,4 @@
- "{{ matrix_docker_package_name }}" - "{{ matrix_docker_package_name }}"
- "python{{'3' if ansible_python.version.major == 3 else ''}}-docker" - "python{{'3' if ansible_python.version.major == 3 else ''}}-docker"
state: latest state: latest
when: matrix_docker_installation_enabled|bool when: matrix_docker_installation_enabled | bool

View file

@ -7,13 +7,13 @@
owner: "root" owner: "root"
group: "root" group: "root"
mode: 0644 mode: 0644
when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce' when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure Docker's RPM key is trusted - name: Ensure Docker's RPM key is trusted
rpm_key: rpm_key:
state: present state: present
key: https://download.docker.com/linux/centos/gpg key: https://download.docker.com/linux/centos/gpg
when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce' when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure yum packages are installed - name: Ensure yum packages are installed
ansible.builtin.yum: ansible.builtin.yum:
@ -28,4 +28,4 @@
- "{{ matrix_docker_package_name }}" - "{{ matrix_docker_package_name }}"
- docker-python - docker-python
state: latest state: latest
when: matrix_docker_installation_enabled|bool when: matrix_docker_installation_enabled | bool

View file

@ -7,13 +7,13 @@
owner: "root" owner: "root"
group: "root" group: "root"
mode: 0644 mode: 0644
when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce' when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure Docker's RPM key is trusted - name: Ensure Docker's RPM key is trusted
rpm_key: rpm_key:
state: present state: present
key: https://download.docker.com/linux/centos/gpg key: https://download.docker.com/linux/centos/gpg
when: matrix_docker_installation_enabled|bool and matrix_docker_package_name == 'docker-ce' when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
- name: Ensure EPEL is installed - name: Ensure EPEL is installed
ansible.builtin.yum: ansible.builtin.yum:
@ -35,10 +35,10 @@
- "{{ matrix_docker_package_name }}" - "{{ matrix_docker_package_name }}"
- python3-pip - python3-pip
state: latest state: latest
when: matrix_docker_installation_enabled|bool when: matrix_docker_installation_enabled | bool
- name: Ensure Docker-Py is installed - name: Ensure Docker-Py is installed
pip: pip:
name: docker-py name: docker-py
state: latest state: latest
when: matrix_docker_installation_enabled|bool when: matrix_docker_installation_enabled | bool

View file

@ -17,7 +17,7 @@
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}" group: "{{ matrix_user_groupname }}"
mode: '0660' mode: '0660'
when: "matrix_vars_yml_snapshotting_enabled|bool" when: "matrix_vars_yml_snapshotting_enabled | bool"
- name: Ensure Matrix network is created in Docker - name: Ensure Matrix network is created in Docker
docker_network: docker_network:

View file

@ -15,7 +15,7 @@
- name: Ensure Matrix /.well-known/matrix/client file configured - name: Ensure Matrix /.well-known/matrix/client file configured
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_well_known_matrix_client_configuration|to_nice_json }}" content: "{{ matrix_well_known_matrix_client_configuration | to_nice_json }}"
dest: "{{ matrix_static_files_base_path }}/.well-known/matrix/client" dest: "{{ matrix_static_files_base_path }}/.well-known/matrix/client"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -23,18 +23,18 @@
- name: Ensure Matrix /.well-known/matrix/server file configured - name: Ensure Matrix /.well-known/matrix/server file configured
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_well_known_matrix_server_configuration|to_nice_json }}" content: "{{ matrix_well_known_matrix_server_configuration | to_nice_json }}"
dest: "{{ matrix_static_files_base_path }}/.well-known/matrix/server" dest: "{{ matrix_static_files_base_path }}/.well-known/matrix/server"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}" group: "{{ matrix_user_groupname }}"
when: matrix_well_known_matrix_server_enabled|bool when: matrix_well_known_matrix_server_enabled | bool
- name: Ensure Matrix /.well-known/matrix/server file deleted - name: Ensure Matrix /.well-known/matrix/server file deleted
ansible.builtin.file: ansible.builtin.file:
path: "{{ matrix_static_files_base_path }}/.well-known/matrix/server" path: "{{ matrix_static_files_base_path }}/.well-known/matrix/server"
state: absent state: absent
when: "not matrix_well_known_matrix_server_enabled|bool" when: "not matrix_well_known_matrix_server_enabled | bool"
- name: Ensure Matrix /.well-known/matrix/support file configured - name: Ensure Matrix /.well-known/matrix/support file configured
ansible.builtin.copy: ansible.builtin.copy:

View file

@ -2,4 +2,4 @@
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-buscarron.service'] }}" matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-buscarron.service'] }}"
when: matrix_bot_buscarron_enabled|bool when: matrix_bot_buscarron_enabled | bool

View file

@ -1,23 +1,23 @@
--- ---
- import_tasks: "{{ role_path }}/tasks/init.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
tags: tags:
- always - always
- import_tasks: "{{ role_path }}/tasks/validate_config.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup|bool and matrix_bot_buscarron_enabled|bool" when: "run_setup | bool and matrix_bot_buscarron_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-bot-buscarron - setup-bot-buscarron
- import_tasks: "{{ role_path }}/tasks/setup_install.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup|bool and matrix_bot_buscarron_enabled|bool" when: "run_setup | bool and matrix_bot_buscarron_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-bot-buscarron - setup-bot-buscarron
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup|bool and not matrix_bot_buscarron_enabled|bool" when: "run_setup | bool and not matrix_bot_buscarron_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-bot-buscarron - setup-bot-buscarron

View file

@ -4,7 +4,7 @@
- block: - block:
- name: Check if an SQLite database already exists - name: Check if an SQLite database already exists
stat: ansible.builtin.stat:
path: "{{ matrix_bot_buscarron_sqlite_database_path_local }}" path: "{{ matrix_bot_buscarron_sqlite_database_path_local }}"
register: matrix_bot_buscarron_sqlite_database_path_local_stat_result register: matrix_bot_buscarron_sqlite_database_path_local_stat_result
@ -13,16 +13,16 @@
matrix_postgres_db_migration_request: matrix_postgres_db_migration_request:
src: "{{ matrix_bot_buscarron_sqlite_database_path_local }}" src: "{{ matrix_bot_buscarron_sqlite_database_path_local }}"
dst: "{{ matrix_bot_buscarron_database_connection_string }}" dst: "{{ matrix_bot_buscarron_database_connection_string }}"
caller: "{{ role_path|basename }}" caller: "{{ role_path | basename }}"
engine_variable_name: 'matrix_bot_buscarron_database_engine' engine_variable_name: 'matrix_bot_buscarron_database_engine'
engine_old: 'sqlite' engine_old: 'sqlite'
systemd_services_to_stop: ['matrix-bot-buscarron.service'] systemd_services_to_stop: ['matrix-bot-buscarron.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: - ansible.builtin.set_fact:
matrix_bot_buscarron_requires_restart: true matrix_bot_buscarron_requires_restart: true
when: "matrix_bot_buscarron_sqlite_database_path_local_stat_result.stat.exists|bool" when: "matrix_bot_buscarron_sqlite_database_path_local_stat_result.stat.exists | bool"
when: "matrix_bot_buscarron_database_engine == 'postgres'" when: "matrix_bot_buscarron_database_engine == 'postgres'"
- name: Ensure buscarron paths exist - name: Ensure buscarron paths exist
@ -37,7 +37,7 @@
- {path: "{{ matrix_bot_buscarron_data_path }}", when: true} - {path: "{{ matrix_bot_buscarron_data_path }}", when: true}
- {path: "{{ matrix_bot_buscarron_data_store_path }}", when: true} - {path: "{{ matrix_bot_buscarron_data_store_path }}", when: true}
- {path: "{{ matrix_bot_buscarron_docker_src_files_path }}", when: true} - {path: "{{ matrix_bot_buscarron_docker_src_files_path }}", when: true}
when: "item.when|bool" when: "item.when | bool"
- name: Ensure buscarron environment variables file created - name: Ensure buscarron environment variables file created
ansible.builtin.template: ansible.builtin.template:
@ -53,7 +53,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_bot_buscarron_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" force_source: "{{ matrix_bot_buscarron_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_bot_buscarron_docker_image_force_pull }}" force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_bot_buscarron_docker_image_force_pull }}"
when: "not matrix_bot_buscarron_container_image_self_build|bool" when: "not matrix_bot_buscarron_container_image_self_build | bool"
register: result register: result
retries: "{{ matrix_container_retries_count }}" retries: "{{ matrix_container_retries_count }}"
delay: "{{ matrix_container_retries_delay }}" delay: "{{ matrix_container_retries_delay }}"
@ -67,7 +67,7 @@
become: true become: true
become_user: "{{ matrix_user_username }}" become_user: "{{ matrix_user_username }}"
register: matrix_bot_buscarron_git_pull_results register: matrix_bot_buscarron_git_pull_results
when: "matrix_bot_buscarron_container_image_self_build|bool" when: "matrix_bot_buscarron_container_image_self_build | bool"
- name: Ensure buscarron image is built - name: Ensure buscarron image is built
docker_image: docker_image:
@ -79,7 +79,7 @@
dockerfile: Dockerfile dockerfile: Dockerfile
path: "{{ matrix_bot_buscarron_docker_src_files_path }}" path: "{{ matrix_bot_buscarron_docker_src_files_path }}"
pull: true pull: true
when: "matrix_bot_buscarron_container_image_self_build|bool" when: "matrix_bot_buscarron_container_image_self_build | bool"
- name: Ensure matrix-bot-buscarron.service installed - name: Ensure matrix-bot-buscarron.service installed
ansible.builtin.template: ansible.builtin.template:
@ -91,10 +91,10 @@
- name: Ensure systemd reloaded after matrix-bot-buscarron.service installation - name: Ensure systemd reloaded after matrix-bot-buscarron.service installation
ansible.builtin.service: ansible.builtin.service:
daemon_reload: true daemon_reload: true
when: "matrix_bot_buscarron_systemd_service_result.changed|bool" when: "matrix_bot_buscarron_systemd_service_result.changed | bool"
- name: Ensure matrix-bot-buscarron.service restarted, if necessary - name: Ensure matrix-bot-buscarron.service restarted, if necessary
ansible.builtin.service: ansible.builtin.service:
name: "matrix-bot-buscarron.service" name: "matrix-bot-buscarron.service"
state: restarted state: restarted
when: "matrix_bot_buscarron_requires_restart|bool" when: "matrix_bot_buscarron_requires_restart | bool"

View file

@ -1,7 +1,7 @@
--- ---
- name: Check existence of matrix-buscarron service - name: Check existence of matrix-buscarron service
stat: ansible.builtin.stat:
path: "{{ matrix_systemd_path }}/matrix-bot-buscarron.service" path: "{{ matrix_systemd_path }}/matrix-bot-buscarron.service"
register: matrix_bot_buscarron_service_stat register: matrix_bot_buscarron_service_stat
@ -12,18 +12,18 @@
enabled: false enabled: false
daemon_reload: true daemon_reload: true
register: stopping_result register: stopping_result
when: "matrix_bot_buscarron_service_stat.stat.exists|bool" when: "matrix_bot_buscarron_service_stat.stat.exists | bool"
- name: Ensure matrix-bot-buscarron.service doesn't exist - name: Ensure matrix-bot-buscarron.service doesn't exist
ansible.builtin.file: ansible.builtin.file:
path: "{{ matrix_systemd_path }}/matrix-bot-buscarron.service" path: "{{ matrix_systemd_path }}/matrix-bot-buscarron.service"
state: absent state: absent
when: "matrix_bot_buscarron_service_stat.stat.exists|bool" when: "matrix_bot_buscarron_service_stat.stat.exists | bool"
- name: Ensure systemd reloaded after matrix-bot-buscarron.service removal - name: Ensure systemd reloaded after matrix-bot-buscarron.service removal
ansible.builtin.service: ansible.builtin.service:
daemon_reload: true daemon_reload: true
when: "matrix_bot_buscarron_service_stat.stat.exists|bool" when: "matrix_bot_buscarron_service_stat.stat.exists | bool"
- name: Ensure Matrix buscarron paths don't exist - name: Ensure Matrix buscarron paths don't exist
ansible.builtin.file: ansible.builtin.file:

View file

@ -224,8 +224,8 @@ matrix_bot_go_neb_configuration_extension_yaml: |
# If you need something more special, you can take full control by # If you need something more special, you can take full control by
# completely redefining `matrix_bot_go_neb_configuration_yaml`. # completely redefining `matrix_bot_go_neb_configuration_yaml`.
matrix_bot_go_neb_configuration_extension: "{{ matrix_bot_go_neb_configuration_extension_yaml|from_yaml if matrix_bot_go_neb_configuration_extension_yaml|from_yaml is mapping else {} }}" matrix_bot_go_neb_configuration_extension: "{{ matrix_bot_go_neb_configuration_extension_yaml | from_yaml if matrix_bot_go_neb_configuration_extension_yaml | from_yaml is mapping else {} }}"
# Holds the final configuration (a combination of the default and its extension). # 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_bot_go_neb_configuration_yaml`. # You most likely don't need to touch this variable. Instead, see `matrix_bot_go_neb_configuration_yaml`.
matrix_bot_go_neb_configuration: "{{ matrix_bot_go_neb_configuration_yaml|from_yaml|combine(matrix_bot_go_neb_configuration_extension, recursive=True) }}" matrix_bot_go_neb_configuration: "{{ matrix_bot_go_neb_configuration_yaml | from_yaml|combine(matrix_bot_go_neb_configuration_extension, recursive=True) }}"

View file

@ -2,4 +2,4 @@
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-go-neb.service'] }}" matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-go-neb.service'] }}"
when: matrix_bot_go_neb_enabled|bool when: matrix_bot_go_neb_enabled | bool

View file

@ -1,23 +1,23 @@
--- ---
- import_tasks: "{{ role_path }}/tasks/init.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
tags: tags:
- always - always
- import_tasks: "{{ role_path }}/tasks/validate_config.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup|bool and matrix_bot_go_neb_enabled|bool" when: "run_setup | bool and matrix_bot_go_neb_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-bot-go-neb - setup-bot-go-neb
- import_tasks: "{{ role_path }}/tasks/setup_install.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup|bool and matrix_bot_go_neb_enabled|bool" when: "run_setup | bool and matrix_bot_go_neb_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-bot-go-neb - setup-bot-go-neb
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup|bool and not matrix_bot_go_neb_enabled|bool" when: "run_setup | bool and not matrix_bot_go_neb_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-bot-go-neb - setup-bot-go-neb

View file

@ -14,7 +14,7 @@
- {path: "{{ matrix_bot_go_neb_config_path }}", when: true} - {path: "{{ matrix_bot_go_neb_config_path }}", when: true}
- {path: "{{ matrix_bot_go_neb_data_path }}", when: true} - {path: "{{ matrix_bot_go_neb_data_path }}", when: true}
- {path: "{{ matrix_bot_go_neb_data_store_path }}", when: true} - {path: "{{ matrix_bot_go_neb_data_store_path }}", when: true}
when: "item.when|bool" when: "item.when | bool"
- name: Ensure go-neb image is pulled - name: Ensure go-neb image is pulled
docker_image: docker_image:
@ -29,7 +29,7 @@
- name: Ensure go-neb config installed - name: Ensure go-neb config installed
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_bot_go_neb_configuration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_bot_go_neb_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_bot_go_neb_config_path }}/config.yaml" dest: "{{ matrix_bot_go_neb_config_path }}/config.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -45,10 +45,10 @@
- name: Ensure systemd reloaded after matrix-bot-go-neb.service installation - name: Ensure systemd reloaded after matrix-bot-go-neb.service installation
ansible.builtin.service: ansible.builtin.service:
daemon_reload: true daemon_reload: true
when: "matrix_bot_go_neb_systemd_service_result.changed|bool" when: "matrix_bot_go_neb_systemd_service_result.changed | bool"
- name: Ensure matrix-bot-go-neb.service restarted, if necessary - name: Ensure matrix-bot-go-neb.service restarted, if necessary
ansible.builtin.service: ansible.builtin.service:
name: "matrix-bot-go-neb.service" name: "matrix-bot-go-neb.service"
state: restarted state: restarted
when: "matrix_bot_go_neb_requires_restart|bool" when: "matrix_bot_go_neb_requires_restart | bool"

View file

@ -1,7 +1,7 @@
--- ---
- name: Check existence of matrix-go-neb service - name: Check existence of matrix-go-neb service
stat: ansible.builtin.stat:
path: "{{ matrix_systemd_path }}/matrix-bot-go-neb.service" path: "{{ matrix_systemd_path }}/matrix-bot-go-neb.service"
register: matrix_bot_go_neb_service_stat register: matrix_bot_go_neb_service_stat
@ -12,18 +12,18 @@
enabled: false enabled: false
daemon_reload: true daemon_reload: true
register: stopping_result register: stopping_result
when: "matrix_bot_go_neb_service_stat.stat.exists|bool" when: "matrix_bot_go_neb_service_stat.stat.exists | bool"
- name: Ensure matrix-bot-go-neb.service doesn't exist - name: Ensure matrix-bot-go-neb.service doesn't exist
ansible.builtin.file: ansible.builtin.file:
path: "{{ matrix_systemd_path }}/matrix-bot-go-neb.service" path: "{{ matrix_systemd_path }}/matrix-bot-go-neb.service"
state: absent state: absent
when: "matrix_bot_go_neb_service_stat.stat.exists|bool" when: "matrix_bot_go_neb_service_stat.stat.exists | bool"
- name: Ensure systemd reloaded after matrix-bot-go-neb.service removal - name: Ensure systemd reloaded after matrix-bot-go-neb.service removal
ansible.builtin.service: ansible.builtin.service:
daemon_reload: true daemon_reload: true
when: "matrix_bot_go_neb_service_stat.stat.exists|bool" when: "matrix_bot_go_neb_service_stat.stat.exists | bool"
- name: Ensure Matrix go-neb paths don't exist - name: Ensure Matrix go-neb paths don't exist
ansible.builtin.file: ansible.builtin.file:

View file

@ -2,4 +2,4 @@
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-honoroit.service'] }}" matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-honoroit.service'] }}"
when: matrix_bot_honoroit_enabled|bool when: matrix_bot_honoroit_enabled | bool

View file

@ -1,23 +1,23 @@
--- ---
- import_tasks: "{{ role_path }}/tasks/init.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
tags: tags:
- always - always
- import_tasks: "{{ role_path }}/tasks/validate_config.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup|bool and matrix_bot_honoroit_enabled|bool" when: "run_setup | bool and matrix_bot_honoroit_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-bot-honoroit - setup-bot-honoroit
- import_tasks: "{{ role_path }}/tasks/setup_install.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup|bool and matrix_bot_honoroit_enabled|bool" when: "run_setup | bool and matrix_bot_honoroit_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-bot-honoroit - setup-bot-honoroit
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup|bool and not matrix_bot_honoroit_enabled|bool" when: "run_setup | bool and not matrix_bot_honoroit_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-bot-honoroit - setup-bot-honoroit

View file

@ -4,7 +4,7 @@
- block: - block:
- name: Check if an SQLite database already exists - name: Check if an SQLite database already exists
stat: ansible.builtin.stat:
path: "{{ matrix_bot_honoroit_sqlite_database_path_local }}" path: "{{ matrix_bot_honoroit_sqlite_database_path_local }}"
register: matrix_bot_honoroit_sqlite_database_path_local_stat_result register: matrix_bot_honoroit_sqlite_database_path_local_stat_result
@ -13,16 +13,16 @@
matrix_postgres_db_migration_request: matrix_postgres_db_migration_request:
src: "{{ matrix_bot_honoroit_sqlite_database_path_local }}" src: "{{ matrix_bot_honoroit_sqlite_database_path_local }}"
dst: "{{ matrix_bot_honoroit_database_connection_string }}" dst: "{{ matrix_bot_honoroit_database_connection_string }}"
caller: "{{ role_path|basename }}" caller: "{{ role_path | basename }}"
engine_variable_name: 'matrix_bot_honoroit_database_engine' engine_variable_name: 'matrix_bot_honoroit_database_engine'
engine_old: 'sqlite' engine_old: 'sqlite'
systemd_services_to_stop: ['matrix-bot-honoroit.service'] systemd_services_to_stop: ['matrix-bot-honoroit.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: - ansible.builtin.set_fact:
matrix_bot_honoroit_requires_restart: true matrix_bot_honoroit_requires_restart: true
when: "matrix_bot_honoroit_sqlite_database_path_local_stat_result.stat.exists|bool" when: "matrix_bot_honoroit_sqlite_database_path_local_stat_result.stat.exists | bool"
when: "matrix_bot_honoroit_database_engine == 'postgres'" when: "matrix_bot_honoroit_database_engine == 'postgres'"
- name: Ensure honoroit paths exist - name: Ensure honoroit paths exist
@ -37,7 +37,7 @@
- {path: "{{ matrix_bot_honoroit_data_path }}", when: true} - {path: "{{ matrix_bot_honoroit_data_path }}", when: true}
- {path: "{{ matrix_bot_honoroit_data_store_path }}", when: true} - {path: "{{ matrix_bot_honoroit_data_store_path }}", when: true}
- {path: "{{ matrix_bot_honoroit_docker_src_files_path }}", when: true} - {path: "{{ matrix_bot_honoroit_docker_src_files_path }}", when: true}
when: "item.when|bool" when: "item.when | bool"
- name: Ensure honoroit environment variables file created - name: Ensure honoroit environment variables file created
ansible.builtin.template: ansible.builtin.template:
@ -53,7 +53,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_bot_honoroit_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" force_source: "{{ matrix_bot_honoroit_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_bot_honoroit_docker_image_force_pull }}" force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_bot_honoroit_docker_image_force_pull }}"
when: "not matrix_bot_honoroit_container_image_self_build|bool" when: "not matrix_bot_honoroit_container_image_self_build | bool"
register: result register: result
retries: "{{ matrix_container_retries_count }}" retries: "{{ matrix_container_retries_count }}"
delay: "{{ matrix_container_retries_delay }}" delay: "{{ matrix_container_retries_delay }}"
@ -67,7 +67,7 @@
become: true become: true
become_user: "{{ matrix_user_username }}" become_user: "{{ matrix_user_username }}"
register: matrix_bot_honoroit_git_pull_results register: matrix_bot_honoroit_git_pull_results
when: "matrix_bot_honoroit_container_image_self_build|bool" when: "matrix_bot_honoroit_container_image_self_build | bool"
- name: Ensure honoroit image is built - name: Ensure honoroit image is built
docker_image: docker_image:
@ -79,7 +79,7 @@
dockerfile: Dockerfile dockerfile: Dockerfile
path: "{{ matrix_bot_honoroit_docker_src_files_path }}" path: "{{ matrix_bot_honoroit_docker_src_files_path }}"
pull: true pull: true
when: "matrix_bot_honoroit_container_image_self_build|bool" when: "matrix_bot_honoroit_container_image_self_build | bool"
- name: Ensure matrix-bot-honoroit.service installed - name: Ensure matrix-bot-honoroit.service installed
ansible.builtin.template: ansible.builtin.template:
@ -91,10 +91,10 @@
- name: Ensure systemd reloaded after matrix-bot-honoroit.service installation - name: Ensure systemd reloaded after matrix-bot-honoroit.service installation
ansible.builtin.service: ansible.builtin.service:
daemon_reload: true daemon_reload: true
when: "matrix_bot_honoroit_systemd_service_result.changed|bool" when: "matrix_bot_honoroit_systemd_service_result.changed | bool"
- name: Ensure matrix-bot-honoroit.service restarted, if necessary - name: Ensure matrix-bot-honoroit.service restarted, if necessary
ansible.builtin.service: ansible.builtin.service:
name: "matrix-bot-honoroit.service" name: "matrix-bot-honoroit.service"
state: restarted state: restarted
when: "matrix_bot_honoroit_requires_restart|bool" when: "matrix_bot_honoroit_requires_restart | bool"

View file

@ -1,7 +1,7 @@
--- ---
- name: Check existence of matrix-honoroit service - name: Check existence of matrix-honoroit service
stat: ansible.builtin.stat:
path: "{{ matrix_systemd_path }}/matrix-bot-honoroit.service" path: "{{ matrix_systemd_path }}/matrix-bot-honoroit.service"
register: matrix_bot_honoroit_service_stat register: matrix_bot_honoroit_service_stat
@ -12,18 +12,18 @@
enabled: false enabled: false
daemon_reload: true daemon_reload: true
register: stopping_result register: stopping_result
when: "matrix_bot_honoroit_service_stat.stat.exists|bool" when: "matrix_bot_honoroit_service_stat.stat.exists | bool"
- name: Ensure matrix-bot-honoroit.service doesn't exist - name: Ensure matrix-bot-honoroit.service doesn't exist
ansible.builtin.file: ansible.builtin.file:
path: "{{ matrix_systemd_path }}/matrix-bot-honoroit.service" path: "{{ matrix_systemd_path }}/matrix-bot-honoroit.service"
state: absent state: absent
when: "matrix_bot_honoroit_service_stat.stat.exists|bool" when: "matrix_bot_honoroit_service_stat.stat.exists | bool"
- name: Ensure systemd reloaded after matrix-bot-honoroit.service removal - name: Ensure systemd reloaded after matrix-bot-honoroit.service removal
ansible.builtin.service: ansible.builtin.service:
daemon_reload: true daemon_reload: true
when: "matrix_bot_honoroit_service_stat.stat.exists|bool" when: "matrix_bot_honoroit_service_stat.stat.exists | bool"
- name: Ensure Matrix honoroit paths don't exist - name: Ensure Matrix honoroit paths don't exist
ansible.builtin.file: ansible.builtin.file:

View file

@ -2,4 +2,4 @@
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-matrix-registration-bot.service'] }}" matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-matrix-registration-bot.service'] }}"
when: matrix_bot_matrix_registration_bot_enabled|bool when: matrix_bot_matrix_registration_bot_enabled | bool

View file

@ -1,23 +1,23 @@
--- ---
- import_tasks: "{{ role_path }}/tasks/init.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
tags: tags:
- always - always
- import_tasks: "{{ role_path }}/tasks/validate_config.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup|bool and matrix_bot_matrix_registration_bot_enabled|bool" when: "run_setup | bool and matrix_bot_matrix_registration_bot_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-bot-matrix-registration-bot - setup-bot-matrix-registration-bot
- import_tasks: "{{ role_path }}/tasks/setup_install.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup|bool and matrix_bot_matrix_registration_bot_enabled|bool" when: "run_setup | bool and matrix_bot_matrix_registration_bot_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-bot-matrix-registration-bot - setup-bot-matrix-registration-bot
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup|bool and not matrix_bot_matrix_registration_bot_enabled|bool" when: "run_setup | bool and not matrix_bot_matrix_registration_bot_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-bot-matrix-registration-bot - setup-bot-matrix-registration-bot

View file

@ -11,7 +11,7 @@
- {path: "{{ matrix_bot_matrix_registration_bot_config_path }}", when: true} - {path: "{{ matrix_bot_matrix_registration_bot_config_path }}", when: true}
- - {path: "{{ matrix_bot_matrix_registration_bot_data_path }}", when: true} - - {path: "{{ matrix_bot_matrix_registration_bot_data_path }}", when: true}
- {path: "{{ matrix_bot_matrix_registration_bot_docker_src_files_path }}", when: true} - {path: "{{ matrix_bot_matrix_registration_bot_docker_src_files_path }}", when: true}
when: "item.when|bool" when: "item.when | bool"
- name: Ensure matrix-registration-bot configuration file created - name: Ensure matrix-registration-bot configuration file created
ansible.builtin.template: ansible.builtin.template:
@ -27,7 +27,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_bot_matrix_registration_bot_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" force_source: "{{ matrix_bot_matrix_registration_bot_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_bot_matrix_registration_bot_docker_image_force_pull }}" force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_bot_matrix_registration_bot_docker_image_force_pull }}"
when: "not matrix_bot_matrix_registration_bot_container_image_self_build|bool" when: "not matrix_bot_matrix_registration_bot_container_image_self_build | bool"
register: result register: result
retries: "{{ matrix_container_retries_count }}" retries: "{{ matrix_container_retries_count }}"
delay: "{{ matrix_container_retries_delay }}" delay: "{{ matrix_container_retries_delay }}"
@ -41,7 +41,7 @@
become: true become: true
become_user: "{{ matrix_user_username }}" become_user: "{{ matrix_user_username }}"
register: matrix_bot_matrix_registration_bot_git_pull_results register: matrix_bot_matrix_registration_bot_git_pull_results
when: "matrix_bot_matrix_registration_bot_container_image_self_build|bool" when: "matrix_bot_matrix_registration_bot_container_image_self_build | bool"
- name: Ensure matrix-registration-bot image is built - name: Ensure matrix-registration-bot image is built
docker_image: docker_image:
@ -53,7 +53,7 @@
dockerfile: Dockerfile dockerfile: Dockerfile
path: "{{ matrix_bot_matrix_registration_bot_docker_src_files_path }}" path: "{{ matrix_bot_matrix_registration_bot_docker_src_files_path }}"
pull: true pull: true
when: "matrix_bot_matrix_registration_bot_container_image_self_build|bool" when: "matrix_bot_matrix_registration_bot_container_image_self_build | bool"
- name: Ensure matrix-bot-matrix-registration-bot.service installed - name: Ensure matrix-bot-matrix-registration-bot.service installed
ansible.builtin.template: ansible.builtin.template:
@ -65,7 +65,7 @@
- name: Ensure systemd reloaded after matrix-bot-matrix-registration-bot.service installation - name: Ensure systemd reloaded after matrix-bot-matrix-registration-bot.service installation
ansible.builtin.service: ansible.builtin.service:
daemon_reload: true daemon_reload: true
when: "matrix_bot_matrix_registration_bot_systemd_service_result.changed|bool" when: "matrix_bot_matrix_registration_bot_systemd_service_result.changed | bool"
- name: Ensure matrix-bot-matrix-registration-bot.service restarted, if necessary - name: Ensure matrix-bot-matrix-registration-bot.service restarted, if necessary
ansible.builtin.service: ansible.builtin.service:

View file

@ -1,7 +1,7 @@
--- ---
- name: Check existence of matrix-matrix-registration-bot service - name: Check existence of matrix-matrix-registration-bot service
stat: ansible.builtin.stat:
path: "{{ matrix_systemd_path }}/matrix-bot-matrix-registration-bot.service" path: "{{ matrix_systemd_path }}/matrix-bot-matrix-registration-bot.service"
register: matrix_bot_matrix_registration_bot_service_stat register: matrix_bot_matrix_registration_bot_service_stat
@ -12,18 +12,18 @@
enabled: false enabled: false
daemon_reload: true daemon_reload: true
register: stopping_result register: stopping_result
when: "matrix_bot_matrix_registration_bot_service_stat.stat.exists|bool" when: "matrix_bot_matrix_registration_bot_service_stat.stat.exists | bool"
- name: Ensure matrix-bot-matrix-registration-bot.service doesn't exist - name: Ensure matrix-bot-matrix-registration-bot.service doesn't exist
ansible.builtin.file: ansible.builtin.file:
path: "{{ matrix_systemd_path }}/matrix-bot-matrix-registration-bot.service" path: "{{ matrix_systemd_path }}/matrix-bot-matrix-registration-bot.service"
state: absent state: absent
when: "matrix_bot_matrix_registration_bot_service_stat.stat.exists|bool" when: "matrix_bot_matrix_registration_bot_service_stat.stat.exists | bool"
- name: Ensure systemd reloaded after matrix-bot-matrix-registration-bot.service removal - name: Ensure systemd reloaded after matrix-bot-matrix-registration-bot.service removal
ansible.builtin.service: ansible.builtin.service:
daemon_reload: true daemon_reload: true
when: "matrix_bot_matrix_registration_bot_service_stat.stat.exists|bool" when: "matrix_bot_matrix_registration_bot_service_stat.stat.exists | bool"
- name: Ensure Matrix matrix-registration-bot paths don't exist - name: Ensure Matrix matrix-registration-bot paths don't exist
ansible.builtin.file: ansible.builtin.file:

View file

@ -93,8 +93,8 @@ matrix_bot_matrix_reminder_bot_configuration_extension_yaml: |
# matrix: # matrix:
# device_name: My-Reminder-Bot # device_name: My-Reminder-Bot
matrix_bot_matrix_reminder_bot_configuration_extension: "{{ matrix_bot_matrix_reminder_bot_configuration_extension_yaml|from_yaml if matrix_bot_matrix_reminder_bot_configuration_extension_yaml|from_yaml is mapping else {} }}" matrix_bot_matrix_reminder_bot_configuration_extension: "{{ matrix_bot_matrix_reminder_bot_configuration_extension_yaml | from_yaml if matrix_bot_matrix_reminder_bot_configuration_extension_yaml | from_yaml is mapping else {} }}"
# Holds the final configuration (a combination of the default and its extension). # 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_bot_matrix_reminder_bot_configuration_yaml`. # You most likely don't need to touch this variable. Instead, see `matrix_bot_matrix_reminder_bot_configuration_yaml`.
matrix_bot_matrix_reminder_bot_configuration: "{{ matrix_bot_matrix_reminder_bot_configuration_yaml|from_yaml|combine(matrix_bot_matrix_reminder_bot_configuration_extension, recursive=True) }}" matrix_bot_matrix_reminder_bot_configuration: "{{ matrix_bot_matrix_reminder_bot_configuration_yaml | from_yaml|combine(matrix_bot_matrix_reminder_bot_configuration_extension, recursive=True) }}"

View file

@ -2,4 +2,4 @@
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-matrix-reminder-bot.service'] }}" matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-matrix-reminder-bot.service'] }}"
when: matrix_bot_matrix_reminder_bot_enabled|bool when: matrix_bot_matrix_reminder_bot_enabled | bool

View file

@ -1,23 +1,23 @@
--- ---
- import_tasks: "{{ role_path }}/tasks/init.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
tags: tags:
- always - always
- import_tasks: "{{ role_path }}/tasks/validate_config.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup|bool and matrix_bot_matrix_reminder_bot_enabled|bool" when: "run_setup | bool and matrix_bot_matrix_reminder_bot_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-bot-matrix-reminder-bot - setup-bot-matrix-reminder-bot
- import_tasks: "{{ role_path }}/tasks/setup_install.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup|bool and matrix_bot_matrix_reminder_bot_enabled|bool" when: "run_setup | bool and matrix_bot_matrix_reminder_bot_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-bot-matrix-reminder-bot - setup-bot-matrix-reminder-bot
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup|bool and not matrix_bot_matrix_reminder_bot_enabled|bool" when: "run_setup | bool and not matrix_bot_matrix_reminder_bot_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-bot-matrix-reminder-bot - setup-bot-matrix-reminder-bot

View file

@ -5,7 +5,7 @@
- block: - block:
- name: Check if an SQLite database already exists - name: Check if an SQLite database already exists
stat: ansible.builtin.stat:
path: "{{ matrix_bot_matrix_reminder_bot_sqlite_database_path_local }}" path: "{{ matrix_bot_matrix_reminder_bot_sqlite_database_path_local }}"
register: matrix_bot_matrix_reminder_bot_sqlite_database_path_local_stat_result register: matrix_bot_matrix_reminder_bot_sqlite_database_path_local_stat_result
@ -14,16 +14,16 @@
matrix_postgres_db_migration_request: matrix_postgres_db_migration_request:
src: "{{ matrix_bot_matrix_reminder_bot_sqlite_database_path_local }}" src: "{{ matrix_bot_matrix_reminder_bot_sqlite_database_path_local }}"
dst: "{{ matrix_bot_matrix_reminder_bot_database_connection_string }}" dst: "{{ matrix_bot_matrix_reminder_bot_database_connection_string }}"
caller: "{{ role_path|basename }}" caller: "{{ role_path | basename }}"
engine_variable_name: 'matrix_bot_matrix_reminder_bot_database_engine' engine_variable_name: 'matrix_bot_matrix_reminder_bot_database_engine'
engine_old: 'sqlite' engine_old: 'sqlite'
systemd_services_to_stop: ['matrix-bot-matrix-reminder-bot.service'] systemd_services_to_stop: ['matrix-bot-matrix-reminder-bot.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: - ansible.builtin.set_fact:
matrix_bot_matrix_reminder_bot_requires_restart: true matrix_bot_matrix_reminder_bot_requires_restart: true
when: "matrix_bot_matrix_reminder_bot_sqlite_database_path_local_stat_result.stat.exists|bool" when: "matrix_bot_matrix_reminder_bot_sqlite_database_path_local_stat_result.stat.exists | bool"
when: "matrix_bot_matrix_reminder_bot_database_engine == 'postgres'" when: "matrix_bot_matrix_reminder_bot_database_engine == 'postgres'"
- name: Ensure matrix-reminder-bot paths exist - name: Ensure matrix-reminder-bot paths exist
@ -38,7 +38,7 @@
- {path: "{{ matrix_bot_matrix_reminder_bot_data_path }}", when: true} - {path: "{{ matrix_bot_matrix_reminder_bot_data_path }}", when: true}
- {path: "{{ matrix_bot_matrix_reminder_bot_data_store_path }}", when: true} - {path: "{{ matrix_bot_matrix_reminder_bot_data_store_path }}", when: true}
- {path: "{{ matrix_bot_matrix_reminder_bot_docker_src_files_path }}", when: true} - {path: "{{ matrix_bot_matrix_reminder_bot_docker_src_files_path }}", when: true}
when: "item.when|bool" when: "item.when | bool"
- name: Ensure matrix-reminder-bot image is pulled - name: Ensure matrix-reminder-bot image is pulled
docker_image: docker_image:
@ -46,7 +46,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_bot_matrix_reminder_bot_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" force_source: "{{ matrix_bot_matrix_reminder_bot_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_bot_matrix_reminder_bot_docker_image_force_pull }}" force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_bot_matrix_reminder_bot_docker_image_force_pull }}"
when: "not matrix_bot_matrix_reminder_bot_container_image_self_build|bool" when: "not matrix_bot_matrix_reminder_bot_container_image_self_build | bool"
register: result register: result
retries: "{{ matrix_container_retries_count }}" retries: "{{ matrix_container_retries_count }}"
delay: "{{ matrix_container_retries_delay }}" delay: "{{ matrix_container_retries_delay }}"
@ -60,7 +60,7 @@
become: true become: true
become_user: "{{ matrix_user_username }}" become_user: "{{ matrix_user_username }}"
register: matrix_bot_matrix_reminder_bot_git_pull_results register: matrix_bot_matrix_reminder_bot_git_pull_results
when: "matrix_bot_matrix_reminder_bot_container_image_self_build|bool" when: "matrix_bot_matrix_reminder_bot_container_image_self_build | bool"
- name: Ensure matrix-reminder-bot image is built - name: Ensure matrix-reminder-bot image is built
docker_image: docker_image:
@ -72,11 +72,11 @@
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
path: "{{ matrix_bot_matrix_reminder_bot_docker_src_files_path }}" path: "{{ matrix_bot_matrix_reminder_bot_docker_src_files_path }}"
pull: true pull: true
when: "matrix_bot_matrix_reminder_bot_container_image_self_build|bool" when: "matrix_bot_matrix_reminder_bot_container_image_self_build | bool"
- name: Ensure matrix-reminder-bot config installed - name: Ensure matrix-reminder-bot config installed
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_bot_matrix_reminder_bot_configuration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_bot_matrix_reminder_bot_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_bot_matrix_reminder_bot_config_path }}/config.yaml" dest: "{{ matrix_bot_matrix_reminder_bot_config_path }}/config.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -92,10 +92,10 @@
- name: Ensure systemd reloaded after matrix-bot-matrix-reminder-bot.service installation - name: Ensure systemd reloaded after matrix-bot-matrix-reminder-bot.service installation
ansible.builtin.service: ansible.builtin.service:
daemon_reload: true daemon_reload: true
when: "matrix_bot_matrix_reminder_bot_systemd_service_result.changed|bool" when: "matrix_bot_matrix_reminder_bot_systemd_service_result.changed | bool"
- name: Ensure matrix-bot-matrix-reminder-bot.service restarted, if necessary - name: Ensure matrix-bot-matrix-reminder-bot.service restarted, if necessary
ansible.builtin.service: ansible.builtin.service:
name: "matrix-bot-matrix-reminder-bot.service" name: "matrix-bot-matrix-reminder-bot.service"
state: restarted state: restarted
when: "matrix_bot_matrix_reminder_bot_requires_restart|bool" when: "matrix_bot_matrix_reminder_bot_requires_restart | bool"

View file

@ -1,7 +1,7 @@
--- ---
- name: Check existence of matrix-matrix-reminder-bot service - name: Check existence of matrix-matrix-reminder-bot service
stat: ansible.builtin.stat:
path: "{{ matrix_systemd_path }}/matrix-bot-matrix-reminder-bot.service" path: "{{ matrix_systemd_path }}/matrix-bot-matrix-reminder-bot.service"
register: matrix_bot_matrix_reminder_bot_service_stat register: matrix_bot_matrix_reminder_bot_service_stat
@ -12,18 +12,18 @@
enabled: false enabled: false
daemon_reload: true daemon_reload: true
register: stopping_result register: stopping_result
when: "matrix_bot_matrix_reminder_bot_service_stat.stat.exists|bool" when: "matrix_bot_matrix_reminder_bot_service_stat.stat.exists | bool"
- name: Ensure matrix-bot-matrix-reminder-bot.service doesn't exist - name: Ensure matrix-bot-matrix-reminder-bot.service doesn't exist
ansible.builtin.file: ansible.builtin.file:
path: "{{ matrix_systemd_path }}/matrix-bot-matrix-reminder-bot.service" path: "{{ matrix_systemd_path }}/matrix-bot-matrix-reminder-bot.service"
state: absent state: absent
when: "matrix_bot_matrix_reminder_bot_service_stat.stat.exists|bool" when: "matrix_bot_matrix_reminder_bot_service_stat.stat.exists | bool"
- name: Ensure systemd reloaded after matrix-bot-matrix-reminder-bot.service removal - name: Ensure systemd reloaded after matrix-bot-matrix-reminder-bot.service removal
ansible.builtin.service: ansible.builtin.service:
daemon_reload: true daemon_reload: true
when: "matrix_bot_matrix_reminder_bot_service_stat.stat.exists|bool" when: "matrix_bot_matrix_reminder_bot_service_stat.stat.exists | bool"
- name: Ensure Matrix matrix-reminder-bot paths don't exist - name: Ensure Matrix matrix-reminder-bot paths don't exist
ansible.builtin.file: ansible.builtin.file:

View file

@ -52,8 +52,8 @@ matrix_bot_mjolnir_configuration_extension_yaml: |
# If you need something more special, you can take full control by # If you need something more special, you can take full control by
# completely redefining `matrix_bot_mjolnir_configuration_yaml`. # completely redefining `matrix_bot_mjolnir_configuration_yaml`.
matrix_bot_mjolnir_configuration_extension: "{{ matrix_bot_mjolnir_configuration_extension_yaml|from_yaml if matrix_bot_mjolnir_configuration_extension_yaml|from_yaml is mapping else {} }}" matrix_bot_mjolnir_configuration_extension: "{{ matrix_bot_mjolnir_configuration_extension_yaml | from_yaml if matrix_bot_mjolnir_configuration_extension_yaml | from_yaml is mapping else {} }}"
# Holds the final configuration (a combination of the default and its extension). # 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_bot_mjolnir_configuration_yaml`. # You most likely don't need to touch this variable. Instead, see `matrix_bot_mjolnir_configuration_yaml`.
matrix_bot_mjolnir_configuration: "{{ matrix_bot_mjolnir_configuration_yaml|from_yaml|combine(matrix_bot_mjolnir_configuration_extension, recursive=True) }}" matrix_bot_mjolnir_configuration: "{{ matrix_bot_mjolnir_configuration_yaml | from_yaml|combine(matrix_bot_mjolnir_configuration_extension, recursive=True) }}"

View file

@ -8,4 +8,4 @@
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-mjolnir.service'] }}" matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-mjolnir.service'] }}"
when: matrix_bot_mjolnir_enabled|bool when: matrix_bot_mjolnir_enabled | bool

View file

@ -1,23 +1,23 @@
--- ---
- import_tasks: "{{ role_path }}/tasks/init.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
tags: tags:
- always - always
- import_tasks: "{{ role_path }}/tasks/validate_config.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup|bool and matrix_bot_mjolnir_enabled|bool" when: "run_setup | bool and matrix_bot_mjolnir_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-bot-mjolnir - setup-bot-mjolnir
- import_tasks: "{{ role_path }}/tasks/setup_install.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup|bool and matrix_bot_mjolnir_enabled|bool" when: "run_setup | bool and matrix_bot_mjolnir_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-bot-mjolnir - setup-bot-mjolnir
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup|bool and not matrix_bot_mjolnir_enabled|bool" when: "run_setup | bool and not matrix_bot_mjolnir_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-bot-mjolnir - setup-bot-mjolnir

View file

@ -15,7 +15,7 @@
- {path: "{{ matrix_bot_mjolnir_config_path }}", when: true} - {path: "{{ matrix_bot_mjolnir_config_path }}", when: true}
- {path: "{{ matrix_bot_mjolnir_data_path }}", when: true} - {path: "{{ matrix_bot_mjolnir_data_path }}", when: true}
- {path: "{{ matrix_bot_mjolnir_docker_src_files_path }}", when: "{{ matrix_bot_mjolnir_container_image_self_build }}"} - {path: "{{ matrix_bot_mjolnir_docker_src_files_path }}", when: "{{ matrix_bot_mjolnir_container_image_self_build }}"}
when: "item.when|bool" when: "item.when | bool"
- name: Ensure mjolnir Docker image is pulled - name: Ensure mjolnir Docker image is pulled
docker_image: docker_image:
@ -23,7 +23,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_bot_mjolnir_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" force_source: "{{ matrix_bot_mjolnir_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_bot_mjolnir_docker_image_force_pull }}" force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_bot_mjolnir_docker_image_force_pull }}"
when: "not matrix_bot_mjolnir_container_image_self_build|bool" when: "not matrix_bot_mjolnir_container_image_self_build | bool"
register: result register: result
retries: "{{ matrix_container_retries_count }}" retries: "{{ matrix_container_retries_count }}"
delay: "{{ matrix_container_retries_delay }}" delay: "{{ matrix_container_retries_delay }}"
@ -38,7 +38,7 @@
become: true become: true
become_user: "{{ matrix_user_username }}" become_user: "{{ matrix_user_username }}"
register: matrix_bot_mjolnir_git_pull_results register: matrix_bot_mjolnir_git_pull_results
when: "matrix_bot_mjolnir_container_image_self_build|bool" when: "matrix_bot_mjolnir_container_image_self_build | bool"
- name: Ensure mjolnir Docker image is built - name: Ensure mjolnir Docker image is built
docker_image: docker_image:
@ -49,11 +49,11 @@
dockerfile: Dockerfile dockerfile: Dockerfile
path: "{{ matrix_bot_mjolnir_docker_src_files_path }}" path: "{{ matrix_bot_mjolnir_docker_src_files_path }}"
pull: true pull: true
when: "matrix_bot_mjolnir_container_image_self_build|bool" when: "matrix_bot_mjolnir_container_image_self_build | bool"
- name: Ensure matrix-bot-mjolnir config installed - name: Ensure matrix-bot-mjolnir config installed
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_bot_mjolnir_configuration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_bot_mjolnir_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_bot_mjolnir_config_path }}/production.yaml" dest: "{{ matrix_bot_mjolnir_config_path }}/production.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -69,10 +69,10 @@
- name: Ensure systemd reloaded after matrix-bot-mjolnir.service installation - name: Ensure systemd reloaded after matrix-bot-mjolnir.service installation
ansible.builtin.service: ansible.builtin.service:
daemon_reload: true daemon_reload: true
when: "matrix_bot_mjolnir_systemd_service_result.changed|bool" when: "matrix_bot_mjolnir_systemd_service_result.changed | bool"
- name: Ensure matrix-bot-mjolnir.service restarted, if necessary - name: Ensure matrix-bot-mjolnir.service restarted, if necessary
ansible.builtin.service: ansible.builtin.service:
name: "matrix-bot-mjolnir.service" name: "matrix-bot-mjolnir.service"
state: restarted state: restarted
when: "matrix_bot_mjolnir_requires_restart|bool" when: "matrix_bot_mjolnir_requires_restart | bool"

View file

@ -1,7 +1,7 @@
--- ---
- name: Check existence of matrix-bot-mjolnir service - name: Check existence of matrix-bot-mjolnir service
stat: ansible.builtin.stat:
path: "{{ matrix_systemd_path }}/matrix-bot-mjolnir.service" path: "{{ matrix_systemd_path }}/matrix-bot-mjolnir.service"
register: matrix_bot_mjolnir_service_stat register: matrix_bot_mjolnir_service_stat
@ -12,18 +12,18 @@
enabled: false enabled: false
daemon_reload: true daemon_reload: true
register: stopping_result register: stopping_result
when: "matrix_bot_mjolnir_service_stat.stat.exists|bool" when: "matrix_bot_mjolnir_service_stat.stat.exists | bool"
- name: Ensure matrix-bot-mjolnir.service doesn't exist - name: Ensure matrix-bot-mjolnir.service doesn't exist
ansible.builtin.file: ansible.builtin.file:
path: "{{ matrix_systemd_path }}/matrix-bot-mjolnir.service" path: "{{ matrix_systemd_path }}/matrix-bot-mjolnir.service"
state: absent state: absent
when: "matrix_bot_mjolnir_service_stat.stat.exists|bool" when: "matrix_bot_mjolnir_service_stat.stat.exists | bool"
- name: Ensure systemd reloaded after matrix-bot-mjolnir.service removal - name: Ensure systemd reloaded after matrix-bot-mjolnir.service removal
ansible.builtin.service: ansible.builtin.service:
daemon_reload: true daemon_reload: true
when: "matrix_bot_mjolnir_service_stat.stat.exists|bool" when: "matrix_bot_mjolnir_service_stat.stat.exists | bool"
- name: Ensure matrix-bot-mjolnir paths don't exist - name: Ensure matrix-bot-mjolnir paths don't exist
ansible.builtin.file: ansible.builtin.file:

View file

@ -87,9 +87,9 @@ matrix_appservice_discord_configuration_extension_yaml: |
# If you need something more special, you can take full control by # If you need something more special, you can take full control by
# completely redefining `matrix_appservice_discord_configuration_yaml`. # completely redefining `matrix_appservice_discord_configuration_yaml`.
matrix_appservice_discord_configuration_extension: "{{ matrix_appservice_discord_configuration_extension_yaml|from_yaml if matrix_appservice_discord_configuration_extension_yaml|from_yaml is mapping else {} }}" matrix_appservice_discord_configuration_extension: "{{ matrix_appservice_discord_configuration_extension_yaml | from_yaml if matrix_appservice_discord_configuration_extension_yaml | from_yaml is mapping else {} }}"
matrix_appservice_discord_configuration: "{{ matrix_appservice_discord_configuration_yaml|from_yaml|combine(matrix_appservice_discord_configuration_extension, recursive=True) }}" matrix_appservice_discord_configuration: "{{ matrix_appservice_discord_configuration_yaml | from_yaml|combine(matrix_appservice_discord_configuration_extension, recursive=True) }}"
matrix_appservice_discord_registration_yaml: | matrix_appservice_discord_registration_yaml: |
#jinja2: lstrip_blocks: "True" #jinja2: lstrip_blocks: "True"
@ -109,4 +109,4 @@ matrix_appservice_discord_registration_yaml: |
protocols: protocols:
- discord - discord
matrix_appservice_discord_registration: "{{ matrix_appservice_discord_registration_yaml|from_yaml }}" matrix_appservice_discord_registration: "{{ matrix_appservice_discord_registration_yaml | from_yaml }}"

View file

@ -5,25 +5,25 @@
ansible.builtin.fail: ansible.builtin.fail:
msg: >- msg: >-
The matrix-bridge-appservice-discord role needs to execute before the matrix-synapse role. The matrix-bridge-appservice-discord role needs to execute before the matrix-synapse role.
when: "matrix_appservice_discord_enabled and matrix_synapse_role_executed|default(False)" when: "matrix_appservice_discord_enabled and matrix_synapse_role_executed | default(False)"
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-appservice-discord.service'] }}" matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-appservice-discord.service'] }}"
when: matrix_appservice_discord_enabled|bool when: matrix_appservice_discord_enabled | bool
# If the matrix-synapse role is not used, these variables may not exist. # If the matrix-synapse role is not used, these variables may not exist.
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_synapse_container_extra_arguments: > matrix_synapse_container_extra_arguments: >
{{ {{
matrix_synapse_container_extra_arguments|default([]) matrix_synapse_container_extra_arguments | default([])
+ +
["--mount type=bind,src={{ matrix_appservice_discord_config_path }}/registration.yaml,dst=/matrix-appservice-discord-registration.yaml,ro"] ["--mount type=bind,src={{ matrix_appservice_discord_config_path }}/registration.yaml,dst=/matrix-appservice-discord-registration.yaml,ro"]
}} }}
matrix_synapse_app_service_config_files: > matrix_synapse_app_service_config_files: >
{{ {{
matrix_synapse_app_service_config_files|default([]) matrix_synapse_app_service_config_files | default([])
+ +
["/matrix-appservice-discord-registration.yaml"] ["/matrix-appservice-discord-registration.yaml"]
}} }}
when: matrix_appservice_discord_enabled|bool when: matrix_appservice_discord_enabled | bool

View file

@ -1,23 +1,23 @@
--- ---
- import_tasks: "{{ role_path }}/tasks/init.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
tags: tags:
- always - always
- import_tasks: "{{ role_path }}/tasks/validate_config.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup|bool and matrix_appservice_discord_enabled|bool" when: "run_setup | bool and matrix_appservice_discord_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-appservice-discord - setup-appservice-discord
- import_tasks: "{{ role_path }}/tasks/setup_install.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup|bool and matrix_appservice_discord_enabled|bool" when: "run_setup | bool and matrix_appservice_discord_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-appservice-discord - setup-appservice-discord
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup|bool and not matrix_appservice_discord_enabled|bool" when: "run_setup | bool and not matrix_appservice_discord_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-appservice-discord - setup-appservice-discord

View file

@ -5,7 +5,7 @@
- block: - block:
- name: Check if an SQLite database already exists - name: Check if an SQLite database already exists
stat: ansible.builtin.stat:
path: "{{ matrix_appservice_discord_sqlite_database_path_local }}" path: "{{ matrix_appservice_discord_sqlite_database_path_local }}"
register: matrix_appservice_discord_sqlite_database_path_local_stat_result register: matrix_appservice_discord_sqlite_database_path_local_stat_result
@ -14,16 +14,16 @@
matrix_postgres_db_migration_request: matrix_postgres_db_migration_request:
src: "{{ matrix_appservice_discord_sqlite_database_path_local }}" src: "{{ matrix_appservice_discord_sqlite_database_path_local }}"
dst: "{{ matrix_appservice_discord_database_connString }}" dst: "{{ matrix_appservice_discord_database_connString }}"
caller: "{{ role_path|basename }}" caller: "{{ role_path | basename }}"
engine_variable_name: 'matrix_appservice_discord_database_engine' engine_variable_name: 'matrix_appservice_discord_database_engine'
engine_old: 'sqlite' engine_old: 'sqlite'
systemd_services_to_stop: ['matrix-appservice-discord.service'] systemd_services_to_stop: ['matrix-appservice-discord.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: - ansible.builtin.set_fact:
matrix_appservice_discord_requires_restart: true matrix_appservice_discord_requires_restart: true
when: "matrix_appservice_discord_sqlite_database_path_local_stat_result.stat.exists|bool" when: "matrix_appservice_discord_sqlite_database_path_local_stat_result.stat.exists | bool"
when: "matrix_appservice_discord_database_engine == 'postgres'" when: "matrix_appservice_discord_database_engine == 'postgres'"
- name: Ensure Appservice Discord image is pulled - name: Ensure Appservice Discord image is pulled
@ -50,7 +50,7 @@
- "{{ matrix_appservice_discord_data_path }}" - "{{ matrix_appservice_discord_data_path }}"
- name: Check if an old database file already exists - name: Check if an old database file already exists
stat: ansible.builtin.stat:
path: "{{ matrix_appservice_discord_base_path }}/discord.db" path: "{{ matrix_appservice_discord_base_path }}/discord.db"
register: matrix_appservice_discord_stat_db register: matrix_appservice_discord_stat_db
@ -73,7 +73,7 @@
- name: Ensure AppService Discord config.yaml installed - name: Ensure AppService Discord config.yaml installed
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_appservice_discord_configuration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_appservice_discord_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_appservice_discord_config_path }}/config.yaml" dest: "{{ matrix_appservice_discord_config_path }}/config.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -81,7 +81,7 @@
- name: Ensure AppService Discord registration.yaml installed - name: Ensure AppService Discord registration.yaml installed
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_appservice_discord_registration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_appservice_discord_registration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_appservice_discord_config_path }}/registration.yaml" dest: "{{ matrix_appservice_discord_config_path }}/registration.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -116,4 +116,4 @@
ansible.builtin.service: ansible.builtin.service:
name: "matrix-appservice-discord.service" name: "matrix-appservice-discord.service"
state: restarted state: restarted
when: "matrix_appservice_discord_requires_restart|bool" when: "matrix_appservice_discord_requires_restart | bool"

View file

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

View file

@ -382,9 +382,9 @@ matrix_appservice_irc_configuration_extension_yaml: |
# If you need something more special, you can take full control by # If you need something more special, you can take full control by
# completely redefining `matrix_appservice_irc_configuration_yaml`. # completely redefining `matrix_appservice_irc_configuration_yaml`.
matrix_appservice_irc_configuration_extension: "{{ matrix_appservice_irc_configuration_extension_yaml|from_yaml if matrix_appservice_irc_configuration_extension_yaml|from_yaml is mapping else {} }}" matrix_appservice_irc_configuration_extension: "{{ matrix_appservice_irc_configuration_extension_yaml | from_yaml if matrix_appservice_irc_configuration_extension_yaml | from_yaml is mapping else {} }}"
matrix_appservice_irc_configuration: "{{ matrix_appservice_irc_configuration_yaml|from_yaml|combine(matrix_appservice_irc_configuration_extension, recursive=True) }}" matrix_appservice_irc_configuration: "{{ matrix_appservice_irc_configuration_yaml | from_yaml|combine(matrix_appservice_irc_configuration_extension, recursive=True) }}"
# The original registration.yaml file generated by AppService IRC is merged with this config override, # The original registration.yaml file generated by AppService IRC is merged with this config override,
# to produce the final registration.yaml file ultimately used by both the bridge and the homeserver. # to produce the final registration.yaml file ultimately used by both the bridge and the homeserver.
@ -399,4 +399,4 @@ matrix_appservice_irc_registration_override_yaml: |
as_token: "{{ matrix_appservice_irc_appservice_token }}" as_token: "{{ matrix_appservice_irc_appservice_token }}"
hs_token: "{{ matrix_appservice_irc_homeserver_token }}" hs_token: "{{ matrix_appservice_irc_homeserver_token }}"
matrix_appservice_irc_registration_override: "{{ matrix_appservice_irc_registration_override_yaml|from_yaml }}" matrix_appservice_irc_registration_override: "{{ matrix_appservice_irc_registration_override_yaml | from_yaml }}"

View file

@ -12,25 +12,25 @@
ansible.builtin.fail: ansible.builtin.fail:
msg: >- msg: >-
The matrix-bridge-appservice-irc role needs to execute before the matrix-synapse role. The matrix-bridge-appservice-irc role needs to execute before the matrix-synapse role.
when: "matrix_appservice_irc_enabled|bool and matrix_synapse_role_executed|default(False)" when: "matrix_appservice_irc_enabled | bool and matrix_synapse_role_executed | default(False)"
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-appservice-irc.service'] }}" matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-appservice-irc.service'] }}"
when: matrix_appservice_irc_enabled|bool when: matrix_appservice_irc_enabled | bool
# If the matrix-synapse role is not used, these variables may not exist. # If the matrix-synapse role is not used, these variables may not exist.
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_synapse_container_extra_arguments: > matrix_synapse_container_extra_arguments: >
{{ {{
matrix_synapse_container_extra_arguments|default([]) matrix_synapse_container_extra_arguments | default([])
+ +
["--mount type=bind,src={{ matrix_appservice_irc_config_path }}/registration.yaml,dst=/matrix-appservice-irc-registration.yaml,ro"] ["--mount type=bind,src={{ matrix_appservice_irc_config_path }}/registration.yaml,dst=/matrix-appservice-irc-registration.yaml,ro"]
}} }}
matrix_synapse_app_service_config_files: > matrix_synapse_app_service_config_files: >
{{ {{
matrix_synapse_app_service_config_files|default([]) matrix_synapse_app_service_config_files | default([])
+ +
["/matrix-appservice-irc-registration.yaml"] ["/matrix-appservice-irc-registration.yaml"]
}} }}
when: matrix_appservice_irc_enabled|bool when: matrix_appservice_irc_enabled | bool

View file

@ -1,23 +1,23 @@
--- ---
- import_tasks: "{{ role_path }}/tasks/init.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
tags: tags:
- always - always
- import_tasks: "{{ role_path }}/tasks/validate_config.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup|bool and matrix_appservice_irc_enabled|bool" when: "run_setup | bool and matrix_appservice_irc_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-appservice-irc - setup-appservice-irc
- import_tasks: "{{ role_path }}/tasks/setup_install.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup|bool and matrix_appservice_irc_enabled|bool" when: "run_setup | bool and matrix_appservice_irc_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-appservice-irc - setup-appservice-irc
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup|bool and not matrix_appservice_irc_enabled|bool" when: "run_setup | bool and not matrix_appservice_irc_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-appservice-irc - setup-appservice-irc

View file

@ -3,14 +3,14 @@
- name: Fail if Postgres not enabled - name: Fail if Postgres not enabled
ansible.builtin.fail: ansible.builtin.fail:
msg: "Postgres via the matrix-postgres role is not enabled (`matrix_postgres_enabled`). Cannot migrate." msg: "Postgres via the matrix-postgres role is not enabled (`matrix_postgres_enabled`). Cannot migrate."
when: "not matrix_postgres_enabled|bool" when: "not matrix_postgres_enabled | bool"
# Defaults # Defaults
- name: Set postgres_start_wait_time, if not provided - name: Set postgres_start_wait_time, if not provided
ansible.builtin.set_fact: ansible.builtin.set_fact:
postgres_start_wait_time: 15 postgres_start_wait_time: 15
when: "postgres_start_wait_time|default('') == ''" when: "postgres_start_wait_time | default('') == ''"
# Actual import work # Actual import work
@ -22,14 +22,14 @@
register: matrix_postgres_service_start_result register: matrix_postgres_service_start_result
- name: Wait a bit, so that Postgres can start - name: Wait a bit, so that Postgres can start
wait_for: ansible.builtin.wait_for:
timeout: "{{ postgres_start_wait_time }}" timeout: "{{ postgres_start_wait_time }}"
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
become: false become: false
when: "matrix_postgres_service_start_result.changed|bool" when: "matrix_postgres_service_start_result.changed | bool"
- name: Check existence of matrix-appservice-irc service - name: Check existence of matrix-appservice-irc service
stat: ansible.builtin.stat:
path: "{{ matrix_systemd_path }}/matrix-appservice-irc.service" path: "{{ matrix_systemd_path }}/matrix-appservice-irc.service"
register: matrix_appservice_irc_service_stat register: matrix_appservice_irc_service_stat
@ -64,7 +64,7 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_playbook_runtime_results: | matrix_playbook_runtime_results: |
{{ {{
matrix_playbook_runtime_results|default([]) matrix_playbook_runtime_results | default([])
+ +
[ [
"NOTE: Your appservice-irc database files have been imported into Postgres. The original database files have been moved from `{{ matrix_appservice_irc_data_path }}/*.db` to `{{ matrix_appservice_irc_data_path }}/*.db.backup`. When you've confirmed that the import went well and everything works, you should be able to safely delete these files." "NOTE: Your appservice-irc database files have been imported into Postgres. The original database files have been moved from `{{ matrix_appservice_irc_data_path }}/*.db` to `{{ matrix_appservice_irc_data_path }}/*.db.backup`. When you've confirmed that the import went well and everything works, you should be able to safely delete these files."

View file

@ -1,6 +1,6 @@
--- ---
- import_tasks: "{{ role_path }}/../matrix-base/tasks/util/ensure_openssl_installed.yml" - ansible.builtin.import_tasks: "{{ role_path }}/../matrix-base/tasks/util/ensure_openssl_installed.yml"
- name: Ensure Appservice IRC paths exist - name: Ensure Appservice IRC paths exist
ansible.builtin.file: ansible.builtin.file:
@ -14,10 +14,10 @@
- {path: "{{ matrix_appservice_irc_config_path }}", when: true} - {path: "{{ matrix_appservice_irc_config_path }}", when: true}
- {path: "{{ matrix_appservice_irc_data_path }}", when: true} - {path: "{{ matrix_appservice_irc_data_path }}", when: true}
- {path: "{{ matrix_appservice_irc_docker_src_files_path }}", when: "{{ matrix_appservice_irc_container_image_self_build }}"} - {path: "{{ matrix_appservice_irc_docker_src_files_path }}", when: "{{ matrix_appservice_irc_container_image_self_build }}"}
when: item.when|bool when: item.when | bool
- name: Check if an old passkey file already exists - name: Check if an old passkey file already exists
stat: ansible.builtin.stat:
path: "{{ matrix_appservice_irc_base_path }}/passkey.pem" path: "{{ matrix_appservice_irc_base_path }}/passkey.pem"
register: matrix_appservice_irc_stat_passkey register: matrix_appservice_irc_stat_passkey
@ -45,16 +45,16 @@
- block: - block:
- name: Check if a nedb database already exists - name: Check if a nedb database already exists
stat: ansible.builtin.stat:
path: "{{ matrix_appservice_irc_data_path }}/users.db" path: "{{ matrix_appservice_irc_data_path }}/users.db"
register: matrix_appservice_irc_nedb_database_path_local_stat_result register: matrix_appservice_irc_nedb_database_path_local_stat_result
- block: - block:
- import_tasks: "{{ role_path }}/tasks/migrate_nedb_to_postgres.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/migrate_nedb_to_postgres.yml"
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_appservice_irc_requires_restart: true matrix_appservice_irc_requires_restart: true
when: "matrix_appservice_irc_nedb_database_path_local_stat_result.stat.exists|bool" when: "matrix_appservice_irc_nedb_database_path_local_stat_result.stat.exists | bool"
when: "matrix_appservice_irc_database_engine == 'postgres'" when: "matrix_appservice_irc_database_engine == 'postgres'"
- name: Ensure Appservice IRC image is pulled - name: Ensure Appservice IRC image is pulled
@ -63,7 +63,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_appservice_irc_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" force_source: "{{ matrix_appservice_irc_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_appservice_irc_docker_image_force_pull }}" force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_appservice_irc_docker_image_force_pull }}"
when: "matrix_appservice_irc_enabled|bool and not matrix_appservice_irc_container_image_self_build|bool" when: "matrix_appservice_irc_enabled | bool and not matrix_appservice_irc_container_image_self_build | bool"
register: result register: result
retries: "{{ matrix_container_retries_count }}" retries: "{{ matrix_container_retries_count }}"
delay: "{{ matrix_container_retries_delay }}" delay: "{{ matrix_container_retries_delay }}"
@ -77,7 +77,7 @@
become: true become: true
become_user: "{{ matrix_user_username }}" become_user: "{{ matrix_user_username }}"
register: matrix_appservice_irc_git_pull_results register: matrix_appservice_irc_git_pull_results
when: "matrix_appservice_irc_enabled|bool and matrix_appservice_irc_container_image_self_build|bool" when: "matrix_appservice_irc_enabled | bool and matrix_appservice_irc_container_image_self_build | bool"
- name: Ensure matrix-appservice-irc Docker image is built - name: Ensure matrix-appservice-irc Docker image is built
docker_image: docker_image:
@ -89,18 +89,18 @@
dockerfile: Dockerfile dockerfile: Dockerfile
path: "{{ matrix_appservice_irc_docker_src_files_path }}" path: "{{ matrix_appservice_irc_docker_src_files_path }}"
pull: true pull: true
when: "matrix_appservice_irc_enabled|bool and matrix_appservice_irc_container_image_self_build|bool and matrix_appservice_irc_git_pull_results.changed" when: "matrix_appservice_irc_enabled | bool and matrix_appservice_irc_container_image_self_build | bool and matrix_appservice_irc_git_pull_results.changed"
- name: Ensure Matrix Appservice IRC config installed - name: Ensure Matrix Appservice IRC config installed
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_appservice_irc_configuration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_appservice_irc_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_appservice_irc_config_path }}/config.yaml" dest: "{{ matrix_appservice_irc_config_path }}/config.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}" group: "{{ matrix_user_groupname }}"
- name: Check if Appservice IRC passkey exists - name: Check if Appservice IRC passkey exists
stat: ansible.builtin.stat:
path: "{{ matrix_appservice_irc_data_path }}/passkey.pem" path: "{{ matrix_appservice_irc_data_path }}/passkey.pem"
register: irc_passkey_file register: irc_passkey_file
@ -177,7 +177,7 @@
- name: Ensure Appservice IRC registration.yaml installed - name: Ensure Appservice IRC registration.yaml installed
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_appservice_irc_registration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_appservice_irc_registration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_appservice_irc_config_path }}/registration.yaml" dest: "{{ matrix_appservice_irc_config_path }}/registration.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -199,4 +199,4 @@
ansible.builtin.service: ansible.builtin.service:
name: "matrix-appservice-irc.service" name: "matrix-appservice-irc.service"
state: restarted state: restarted
when: "matrix_appservice_irc_requires_restart|bool" when: "matrix_appservice_irc_requires_restart | bool"

View file

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

View file

@ -95,9 +95,9 @@ matrix_appservice_slack_configuration_extension_yaml: |
# - "./debug.log": "info" # - "./debug.log": "info"
#- "./error.log": "error" #- "./error.log": "error"
matrix_appservice_slack_configuration_extension: "{{ matrix_appservice_slack_configuration_extension_yaml|from_yaml if matrix_appservice_slack_configuration_extension_yaml|from_yaml else {} }}" matrix_appservice_slack_configuration_extension: "{{ matrix_appservice_slack_configuration_extension_yaml | from_yaml if matrix_appservice_slack_configuration_extension_yaml | from_yaml else {} }}"
matrix_appservice_slack_configuration: "{{ matrix_appservice_slack_configuration_yaml|from_yaml|combine(matrix_appservice_slack_configuration_extension, recursive=True) }}" matrix_appservice_slack_configuration: "{{ matrix_appservice_slack_configuration_yaml | from_yaml|combine(matrix_appservice_slack_configuration_extension, recursive=True) }}"
matrix_appservice_slack_registration_yaml: | matrix_appservice_slack_registration_yaml: |
id: "{{ matrix_appservice_slack_id_token }}" id: "{{ matrix_appservice_slack_id_token }}"
@ -116,4 +116,4 @@ matrix_appservice_slack_registration_yaml: |
rate_limited: true rate_limited: true
protocols: null protocols: null
matrix_appservice_slack_registration: "{{ matrix_appservice_slack_registration_yaml|from_yaml }}" matrix_appservice_slack_registration: "{{ matrix_appservice_slack_registration_yaml | from_yaml }}"

View file

@ -12,28 +12,28 @@
ansible.builtin.fail: ansible.builtin.fail:
msg: >- msg: >-
The matrix-bridge-appservice-slack role needs to execute before the matrix-synapse role. The matrix-bridge-appservice-slack 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: - ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-appservice-slack.service'] }}" matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-appservice-slack.service'] }}"
when: matrix_appservice_slack_enabled|bool when: matrix_appservice_slack_enabled | bool
# If the matrix-synapse role is not used, these variables may not exist. # If the matrix-synapse role is not used, these variables may not exist.
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_synapse_container_extra_arguments: > matrix_synapse_container_extra_arguments: >
{{ {{
matrix_synapse_container_extra_arguments|default([]) matrix_synapse_container_extra_arguments | default([])
+ +
["--mount type=bind,src={{ matrix_appservice_slack_config_path }}/slack-registration.yaml,dst=/matrix-appservice-slack-registration.yaml,ro"] ["--mount type=bind,src={{ matrix_appservice_slack_config_path }}/slack-registration.yaml,dst=/matrix-appservice-slack-registration.yaml,ro"]
}} }}
matrix_synapse_app_service_config_files: > matrix_synapse_app_service_config_files: >
{{ {{
matrix_synapse_app_service_config_files|default([]) matrix_synapse_app_service_config_files | default([])
+ +
["/matrix-appservice-slack-registration.yaml"] ["/matrix-appservice-slack-registration.yaml"]
}} }}
when: matrix_appservice_slack_enabled|bool when: matrix_appservice_slack_enabled | bool
# If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist. # If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist.
# We don't want to fail in such cases. # We don't want to fail in such cases.
@ -41,7 +41,7 @@
ansible.builtin.fail: ansible.builtin.fail:
msg: >- msg: >-
The matrix-bridge-appservice-slack role needs to execute before the matrix-synapse role. The matrix-bridge-appservice-slack role needs to execute before the matrix-synapse role.
when: "matrix_synapse_role_executed|default(False)" when: "matrix_synapse_role_executed | default(False)"
- block: - block:
- name: Fail if matrix-nginx-proxy role already executed - name: Fail if matrix-nginx-proxy role already executed
@ -51,13 +51,13 @@
but it's pointless since the matrix-nginx-proxy role had already executed. 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, 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-appservice-slack role. so that the matrix-nginx-proxy role would run after the matrix-bridge-appservice-slack role.
when: matrix_nginx_proxy_role_executed|default(False)|bool when: matrix_nginx_proxy_role_executed | default(False) | bool
- name: Generate Matrix Appservice Slack proxying configuration for matrix-nginx-proxy - name: Generate Matrix Appservice Slack proxying configuration for matrix-nginx-proxy
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_appservice_slack_matrix_nginx_proxy_configuration: | matrix_appservice_slack_matrix_nginx_proxy_configuration: |
location {{ matrix_appservice_slack_public_endpoint }} { location {{ matrix_appservice_slack_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 #} {# Use the embedded DNS resolver in Docker containers to discover the service #}
resolver 127.0.0.11 valid=5s; resolver 127.0.0.11 valid=5s;
set $backend "{{ matrix_appservice_slack_appservice_url }}:{{ matrix_appservice_slack_slack_port }}"; set $backend "{{ matrix_appservice_slack_appservice_url }}:{{ matrix_appservice_slack_slack_port }}";
@ -72,13 +72,13 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | 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_appservice_slack_matrix_nginx_proxy_configuration] [matrix_appservice_slack_matrix_nginx_proxy_configuration]
}} }}
tags: tags:
- always - always
when: matrix_appservice_slack_enabled|bool when: matrix_appservice_slack_enabled | bool
- name: Warn about reverse-proxying if matrix-nginx-proxy not used - name: Warn about reverse-proxying if matrix-nginx-proxy not used
ansible.builtin.debug: ansible.builtin.debug:
@ -88,4 +88,4 @@
Please make sure that you're proxying the `{{ something }}` Please make sure that you're proxying the `{{ something }}`
URL endpoint to the matrix-appservice-slack container. URL endpoint to the matrix-appservice-slack container.
You can expose the container's port using the `matrix_appservice_slack_container_http_host_bind_port` variable. You can expose the container's port using the `matrix_appservice_slack_container_http_host_bind_port` variable.
when: "matrix_appservice_slack_enabled|bool and not matrix_nginx_proxy_enabled|default(False)|bool" when: "matrix_appservice_slack_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: tags:
- always - always
- import_tasks: "{{ role_path }}/tasks/validate_config.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup|bool and matrix_appservice_slack_enabled|bool" when: "run_setup | bool and matrix_appservice_slack_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-appservice-slack - setup-appservice-slack
- import_tasks: "{{ role_path }}/tasks/setup_install.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup|bool and matrix_appservice_slack_enabled|bool" when: "run_setup | bool and matrix_appservice_slack_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-appservice-slack - setup-appservice-slack
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup|bool and not matrix_appservice_slack_enabled|bool" when: "run_setup | bool and not matrix_appservice_slack_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-appservice-slack - setup-appservice-slack

View file

@ -3,14 +3,14 @@
- name: Fail if Postgres not enabled - name: Fail if Postgres not enabled
ansible.builtin.fail: ansible.builtin.fail:
msg: "Postgres via the matrix-postgres role is not enabled (`matrix_postgres_enabled`). Cannot migrate." msg: "Postgres via the matrix-postgres role is not enabled (`matrix_postgres_enabled`). Cannot migrate."
when: "not matrix_postgres_enabled|bool" when: "not matrix_postgres_enabled | bool"
# Defaults # Defaults
- name: Set postgres_start_wait_time, if not provided - name: Set postgres_start_wait_time, if not provided
ansible.builtin.set_fact: ansible.builtin.set_fact:
postgres_start_wait_time: 15 postgres_start_wait_time: 15
when: "postgres_start_wait_time|default('') == ''" when: "postgres_start_wait_time | default('') == ''"
# Actual import work # Actual import work
@ -22,11 +22,11 @@
register: matrix_postgres_service_start_result register: matrix_postgres_service_start_result
- name: Wait a bit, so that Postgres can start - name: Wait a bit, so that Postgres can start
wait_for: ansible.builtin.wait_for:
timeout: "{{ postgres_start_wait_time }}" timeout: "{{ postgres_start_wait_time }}"
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
become: false become: false
when: "matrix_postgres_service_start_result.changed|bool" when: "matrix_postgres_service_start_result.changed | bool"
- name: Ensure matrix-appservice-slack is stopped - name: Ensure matrix-appservice-slack is stopped
ansible.builtin.service: ansible.builtin.service:
@ -60,7 +60,7 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_playbook_runtime_results: | matrix_playbook_runtime_results: |
{{ {{
matrix_playbook_runtime_results|default([]) matrix_playbook_runtime_results | default([])
+ +
[ [
"NOTE: Your appservice-slack database files have been imported into Postgres. The original database files have been moved from `{{ matrix_appservice_slack_data_path }}/*.db` to `{{ matrix_appservice_slack_data_path }}/*.db.backup`. When you've confirmed that the import went well and everything works, you should be able to safely delete these files." "NOTE: Your appservice-slack database files have been imported into Postgres. The original database files have been moved from `{{ matrix_appservice_slack_data_path }}/*.db` to `{{ matrix_appservice_slack_data_path }}/*.db.backup`. When you've confirmed that the import went well and everything works, you should be able to safely delete these files."

View file

@ -12,23 +12,23 @@
- {path: "{{ matrix_appservice_slack_config_path }}", when: true} - {path: "{{ matrix_appservice_slack_config_path }}", when: true}
- {path: "{{ matrix_appservice_slack_data_path }}", when: true} - {path: "{{ matrix_appservice_slack_data_path }}", when: true}
- {path: "{{ matrix_appservice_slack_docker_src_files_path }}", when: "{{ matrix_appservice_slack_container_image_self_build }}"} - {path: "{{ matrix_appservice_slack_docker_src_files_path }}", when: "{{ matrix_appservice_slack_container_image_self_build }}"}
when: item.when|bool when: item.when | bool
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_appservice_slack_requires_restart: false matrix_appservice_slack_requires_restart: false
- block: - block:
- name: Check if a nedb database already exists - name: Check if a nedb database already exists
stat: ansible.builtin.stat:
path: "{{ matrix_appservice_slack_data_path }}/teams.db" path: "{{ matrix_appservice_slack_data_path }}/teams.db"
register: matrix_appservice_slack_nedb_database_path_local_stat_result register: matrix_appservice_slack_nedb_database_path_local_stat_result
- block: - block:
- import_tasks: "{{ role_path }}/tasks/migrate_nedb_to_postgres.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/migrate_nedb_to_postgres.yml"
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_appservice_slack_requires_restart: true matrix_appservice_slack_requires_restart: true
when: "matrix_appservice_slack_nedb_database_path_local_stat_result.stat.exists|bool" when: "matrix_appservice_slack_nedb_database_path_local_stat_result.stat.exists | bool"
when: "matrix_appservice_slack_database_engine == 'postgres'" when: "matrix_appservice_slack_database_engine == 'postgres'"
- name: Ensure Appservice Slack image is pulled - name: Ensure Appservice Slack image is pulled
@ -37,7 +37,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_appservice_slack_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" force_source: "{{ matrix_appservice_slack_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_appservice_slack_docker_image_force_pull }}" force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_appservice_slack_docker_image_force_pull }}"
when: "not matrix_appservice_slack_container_image_self_build|bool" when: "not matrix_appservice_slack_container_image_self_build | bool"
register: result register: result
retries: "{{ matrix_container_retries_count }}" retries: "{{ matrix_container_retries_count }}"
delay: "{{ matrix_container_retries_delay }}" delay: "{{ matrix_container_retries_delay }}"
@ -51,7 +51,7 @@
become: true become: true
become_user: "{{ matrix_user_username }}" become_user: "{{ matrix_user_username }}"
register: matrix_appservice_slack_git_pull_results register: matrix_appservice_slack_git_pull_results
when: "matrix_appservice_slack_container_image_self_build|bool" when: "matrix_appservice_slack_container_image_self_build | bool"
- name: Ensure matrix-appservice-slack Docker image is built - name: Ensure matrix-appservice-slack Docker image is built
docker_image: docker_image:
@ -63,11 +63,11 @@
dockerfile: Dockerfile dockerfile: Dockerfile
path: "{{ matrix_appservice_slack_docker_src_files_path }}" path: "{{ matrix_appservice_slack_docker_src_files_path }}"
pull: true pull: true
when: "matrix_appservice_slack_container_image_self_build|bool and matrix_appservice_slack_git_pull_results.changed" when: "matrix_appservice_slack_container_image_self_build | bool and matrix_appservice_slack_git_pull_results.changed"
- name: Ensure Matrix Appservice Slack config installed - name: Ensure Matrix Appservice Slack config installed
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_appservice_slack_configuration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_appservice_slack_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_appservice_slack_config_path }}/config.yaml" dest: "{{ matrix_appservice_slack_config_path }}/config.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -75,7 +75,7 @@
- name: Ensure appservice-slack registration.yaml installed - name: Ensure appservice-slack registration.yaml installed
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_appservice_slack_registration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_appservice_slack_registration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_appservice_slack_config_path }}/slack-registration.yaml" dest: "{{ matrix_appservice_slack_config_path }}/slack-registration.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -97,4 +97,4 @@
ansible.builtin.service: ansible.builtin.service:
name: "matrix-appservice-slack.service" name: "matrix-appservice-slack.service"
state: restarted state: restarted
when: "matrix_appservice_slack_requires_restart|bool" when: "matrix_appservice_slack_requires_restart | bool"

View file

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

View file

@ -61,9 +61,9 @@ matrix_appservice_webhooks_configuration_yaml: "{{ lookup('template', 'templates
matrix_appservice_webhooks_configuration_extension_yaml: | matrix_appservice_webhooks_configuration_extension_yaml: |
# #
matrix_appservice_webhooks_configuration_extension: "{{ matrix_appservice_webhooks_configuration_extension_yaml|from_yaml if matrix_appservice_webhooks_configuration_extension_yaml|from_yaml else {} }}" matrix_appservice_webhooks_configuration_extension: "{{ matrix_appservice_webhooks_configuration_extension_yaml | from_yaml if matrix_appservice_webhooks_configuration_extension_yaml | from_yaml else {} }}"
matrix_appservice_webhooks_configuration: "{{ matrix_appservice_webhooks_configuration_yaml|from_yaml|combine(matrix_appservice_webhooks_configuration_extension, recursive=True) }}" matrix_appservice_webhooks_configuration: "{{ matrix_appservice_webhooks_configuration_yaml | from_yaml|combine(matrix_appservice_webhooks_configuration_extension, recursive=True) }}"
matrix_appservice_webhooks_registration_yaml: | matrix_appservice_webhooks_registration_yaml: |
id: "{{ matrix_appservice_webhooks_id_token }}" id: "{{ matrix_appservice_webhooks_id_token }}"
@ -80,4 +80,4 @@ matrix_appservice_webhooks_registration_yaml: |
rate_limited: false rate_limited: false
protocols: null protocols: null
matrix_appservice_webhooks_registration: "{{ matrix_appservice_webhooks_registration_yaml|from_yaml }}" matrix_appservice_webhooks_registration: "{{ matrix_appservice_webhooks_registration_yaml | from_yaml }}"

View file

@ -5,28 +5,28 @@
ansible.builtin.fail: ansible.builtin.fail:
msg: >- msg: >-
The matrix-bridge-appservice-webhooks role needs to execute before the matrix-synapse role. The matrix-bridge-appservice-webhooks 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: - ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-appservice-webhooks.service'] }}" matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-appservice-webhooks.service'] }}"
when: matrix_appservice_webhooks_enabled|bool when: matrix_appservice_webhooks_enabled | bool
# If the matrix-synapse role is not used, these variables may not exist. # If the matrix-synapse role is not used, these variables may not exist.
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_synapse_container_extra_arguments: > matrix_synapse_container_extra_arguments: >
{{ {{
matrix_synapse_container_extra_arguments|default([]) matrix_synapse_container_extra_arguments | default([])
+ +
["--mount type=bind,src={{ matrix_appservice_webhooks_config_path }}/webhooks-registration.yaml,dst=/matrix-appservice-webhooks-registration.yaml,ro"] ["--mount type=bind,src={{ matrix_appservice_webhooks_config_path }}/webhooks-registration.yaml,dst=/matrix-appservice-webhooks-registration.yaml,ro"]
}} }}
matrix_synapse_app_service_config_files: > matrix_synapse_app_service_config_files: >
{{ {{
matrix_synapse_app_service_config_files|default([]) matrix_synapse_app_service_config_files | default([])
+ +
["/matrix-appservice-webhooks-registration.yaml"] ["/matrix-appservice-webhooks-registration.yaml"]
}} }}
when: matrix_appservice_webhooks_enabled|bool when: matrix_appservice_webhooks_enabled | bool
# If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist. # If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist.
# We don't want to fail in such cases. # We don't want to fail in such cases.
@ -34,7 +34,7 @@
ansible.builtin.fail: ansible.builtin.fail:
msg: >- msg: >-
The matrix-bridge-appservice-webhooks role needs to execute before the matrix-synapse role. The matrix-bridge-appservice-webhooks role needs to execute before the matrix-synapse role.
when: "matrix_synapse_role_executed|default(False)" when: "matrix_synapse_role_executed | default(False)"
- block: - block:
- name: Fail if matrix-nginx-proxy role already executed - name: Fail if matrix-nginx-proxy role already executed
@ -44,12 +44,12 @@
but it's pointless since the matrix-nginx-proxy role had already executed. 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, 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-appservice-webhooks role. so that the matrix-nginx-proxy role would run after the matrix-bridge-appservice-webhooks role.
when: matrix_nginx_proxy_role_executed|default(False)|bool when: matrix_nginx_proxy_role_executed | default(False) | bool
- name: Generate Matrix Appservice webhooks proxying configuration for matrix-nginx-proxy - name: Generate Matrix Appservice webhooks proxying configuration for matrix-nginx-proxy
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_appservice_webhooks_matrix_nginx_proxy_configuration: | matrix_appservice_webhooks_matrix_nginx_proxy_configuration: |
{% 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 #} {# Use the embedded DNS resolver in Docker containers to discover the service #}
location ~ ^{{ matrix_appservice_webhooks_public_endpoint }}/(.*)$ { location ~ ^{{ matrix_appservice_webhooks_public_endpoint }}/(.*)$ {
resolver 127.0.0.11 valid=5s; resolver 127.0.0.11 valid=5s;
@ -67,13 +67,13 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | 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_appservice_webhooks_matrix_nginx_proxy_configuration] [matrix_appservice_webhooks_matrix_nginx_proxy_configuration]
}} }}
tags: tags:
- always - always
when: matrix_appservice_webhooks_enabled|bool when: matrix_appservice_webhooks_enabled | bool
- name: Warn about reverse-proxying if matrix-nginx-proxy not used - name: Warn about reverse-proxying if matrix-nginx-proxy not used
ansible.builtin.debug: ansible.builtin.debug:
@ -83,4 +83,4 @@
Please make sure that you're proxying the `{{ matrix_appservice_webhooks_public_endpoint }}` Please make sure that you're proxying the `{{ matrix_appservice_webhooks_public_endpoint }}`
URL endpoint to the matrix-appservice-webhooks container. URL endpoint to the matrix-appservice-webhooks container.
You can expose the container's port using the `matrix_appservice_webhooks_container_http_host_bind_port` variable. You can expose the container's port using the `matrix_appservice_webhooks_container_http_host_bind_port` variable.
when: "matrix_appservice_webhooks_enabled|bool and not matrix_nginx_proxy_enabled|default(False)|bool" when: "matrix_appservice_webhooks_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: tags:
- always - always
- import_tasks: "{{ role_path }}/tasks/validate_config.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup|bool and matrix_appservice_webhooks_enabled|bool" when: "run_setup | bool and matrix_appservice_webhooks_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-appservice-webhooks - setup-appservice-webhooks
- import_tasks: "{{ role_path }}/tasks/setup_install.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup|bool and matrix_appservice_webhooks_enabled|bool" when: "run_setup | bool and matrix_appservice_webhooks_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-appservice-webhooks - setup-appservice-webhooks
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup|bool and not matrix_appservice_webhooks_enabled|bool" when: "run_setup | bool and not matrix_appservice_webhooks_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-appservice-webhooks - setup-appservice-webhooks

View file

@ -12,7 +12,7 @@
- {path: "{{ matrix_appservice_webhooks_config_path }}", when: true} - {path: "{{ matrix_appservice_webhooks_config_path }}", when: true}
- {path: "{{ matrix_appservice_webhooks_data_path }}", when: true} - {path: "{{ matrix_appservice_webhooks_data_path }}", when: true}
- {path: "{{ matrix_appservice_webhooks_docker_src_files_path }}", when: "{{ matrix_appservice_webhooks_container_image_self_build }}"} - {path: "{{ matrix_appservice_webhooks_docker_src_files_path }}", when: "{{ matrix_appservice_webhooks_container_image_self_build }}"}
when: "item.when|bool" when: "item.when | bool"
- name: Ensure Appservice webhooks image is pulled - name: Ensure Appservice webhooks image is pulled
docker_image: docker_image:
@ -20,7 +20,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_appservice_webhooks_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" force_source: "{{ matrix_appservice_webhooks_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_appservice_webhooks_docker_image_force_pull }}" force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_appservice_webhooks_docker_image_force_pull }}"
when: "not matrix_appservice_webhooks_container_image_self_build|bool" when: "not matrix_appservice_webhooks_container_image_self_build | bool"
register: result register: result
retries: "{{ matrix_container_retries_count }}" retries: "{{ matrix_container_retries_count }}"
delay: "{{ matrix_container_retries_delay }}" delay: "{{ matrix_container_retries_delay }}"
@ -47,11 +47,11 @@
dockerfile: "{{ matrix_appservice_webhooks_container_image_self_build_repo_dockerfile_path }}" dockerfile: "{{ matrix_appservice_webhooks_container_image_self_build_repo_dockerfile_path }}"
path: "{{ matrix_appservice_webhooks_docker_src_files_path }}" path: "{{ matrix_appservice_webhooks_docker_src_files_path }}"
pull: true pull: true
when: "matrix_appservice_webhooks_container_image_self_build|bool" when: "matrix_appservice_webhooks_container_image_self_build | bool"
- name: Ensure Matrix Appservice webhooks config is installed - name: Ensure Matrix Appservice webhooks config is installed
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_appservice_webhooks_configuration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_appservice_webhooks_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_appservice_webhooks_config_path }}/config.yaml" dest: "{{ matrix_appservice_webhooks_config_path }}/config.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -75,7 +75,7 @@
- name: Ensure appservice-webhooks registration.yaml installed - name: Ensure appservice-webhooks registration.yaml installed
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_appservice_webhooks_registration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_appservice_webhooks_registration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_appservice_webhooks_config_path }}/webhooks-registration.yaml" dest: "{{ matrix_appservice_webhooks_config_path }}/webhooks-registration.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"

View file

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

View file

@ -88,11 +88,11 @@ matrix_beeper_linkedin_configuration_extension_yaml: |
# If you need something more special, you can take full control by # If you need something more special, you can take full control by
# completely redefining `matrix_beeper_linkedin_configuration_yaml`. # completely redefining `matrix_beeper_linkedin_configuration_yaml`.
matrix_beeper_linkedin_configuration_extension: "{{ matrix_beeper_linkedin_configuration_extension_yaml|from_yaml if matrix_beeper_linkedin_configuration_extension_yaml|from_yaml is mapping else {} }}" matrix_beeper_linkedin_configuration_extension: "{{ matrix_beeper_linkedin_configuration_extension_yaml | from_yaml if matrix_beeper_linkedin_configuration_extension_yaml | from_yaml is mapping else {} }}"
# Holds the final configuration (a combination of the default and its extension). # 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_beeper_linkedin_configuration_yaml`. # You most likely don't need to touch this variable. Instead, see `matrix_beeper_linkedin_configuration_yaml`.
matrix_beeper_linkedin_configuration: "{{ matrix_beeper_linkedin_configuration_yaml|from_yaml|combine(matrix_beeper_linkedin_configuration_extension, recursive=True) }}" matrix_beeper_linkedin_configuration: "{{ matrix_beeper_linkedin_configuration_yaml | from_yaml|combine(matrix_beeper_linkedin_configuration_extension, recursive=True) }}"
matrix_beeper_linkedin_registration_yaml: | matrix_beeper_linkedin_registration_yaml: |
id: linkedin id: linkedin
@ -110,4 +110,4 @@ matrix_beeper_linkedin_registration_yaml: |
regex: '^@{{ matrix_beeper_linkedin_appservice_bot_username|regex_escape }}:{{ matrix_beeper_linkedin_homeserver_domain|regex_escape }}$' regex: '^@{{ matrix_beeper_linkedin_appservice_bot_username|regex_escape }}:{{ matrix_beeper_linkedin_homeserver_domain|regex_escape }}$'
de.sorunome.msc2409.push_ephemeral: true de.sorunome.msc2409.push_ephemeral: true
matrix_beeper_linkedin_registration: "{{ matrix_beeper_linkedin_registration_yaml|from_yaml }}" matrix_beeper_linkedin_registration: "{{ matrix_beeper_linkedin_registration_yaml | from_yaml }}"

View file

@ -2,21 +2,21 @@
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-beeper-linkedin.service'] }}" matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-beeper-linkedin.service'] }}"
when: matrix_beeper_linkedin_enabled|bool when: matrix_beeper_linkedin_enabled | bool
# If the matrix-synapse role is not used, these variables may not exist. # If the matrix-synapse role is not used, these variables may not exist.
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_synapse_container_extra_arguments: > matrix_synapse_container_extra_arguments: >
{{ {{
matrix_synapse_container_extra_arguments|default([]) matrix_synapse_container_extra_arguments | default([])
+ +
["--mount type=bind,src={{ matrix_beeper_linkedin_config_path }}/registration.yaml,dst=/matrix-beeper-linkedin-registration.yaml,ro"] ["--mount type=bind,src={{ matrix_beeper_linkedin_config_path }}/registration.yaml,dst=/matrix-beeper-linkedin-registration.yaml,ro"]
}} }}
matrix_synapse_app_service_config_files: > matrix_synapse_app_service_config_files: >
{{ {{
matrix_synapse_app_service_config_files|default([]) matrix_synapse_app_service_config_files | default([])
+ +
["/matrix-beeper-linkedin-registration.yaml"] ["/matrix-beeper-linkedin-registration.yaml"]
}} }}
when: matrix_beeper_linkedin_enabled|bool when: matrix_beeper_linkedin_enabled | bool

View file

@ -1,22 +1,22 @@
--- ---
- import_tasks: "{{ role_path }}/tasks/init.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
tags: tags:
- always - always
- import_tasks: "{{ role_path }}/tasks/validate_config.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup|bool and matrix_beeper_linkedin_enabled|bool" when: "run_setup | bool and matrix_beeper_linkedin_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-beeper-linkedin - setup-beeper-linkedin
- import_tasks: "{{ role_path }}/tasks/setup_install.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup and matrix_beeper_linkedin_enabled" when: "run_setup and matrix_beeper_linkedin_enabled"
tags: tags:
- setup-all - setup-all
- setup-beeper-linkedin - setup-beeper-linkedin
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup and not matrix_beeper_linkedin_enabled" when: "run_setup and not matrix_beeper_linkedin_enabled"
tags: tags:
- setup-all - setup-all

View file

@ -6,7 +6,7 @@
ansible.builtin.fail: ansible.builtin.fail:
msg: >- msg: >-
The matrix-bridge-beeper-linkedin role needs to execute before the matrix-synapse role. The matrix-bridge-beeper-linkedin role needs to execute before the matrix-synapse role.
when: "matrix_synapse_role_executed|default(False)" when: "matrix_synapse_role_executed | default(False)"
- name: Ensure Beeper LinkedIn paths exists - name: Ensure Beeper LinkedIn paths exists
ansible.builtin.file: ansible.builtin.file:
path: "{{ item.path }}" path: "{{ item.path }}"
@ -19,7 +19,7 @@
- {path: "{{ matrix_beeper_linkedin_config_path }}", when: true} - {path: "{{ matrix_beeper_linkedin_config_path }}", when: true}
- {path: "{{ matrix_beeper_linkedin_data_path }}", when: true} - {path: "{{ matrix_beeper_linkedin_data_path }}", when: true}
- {path: "{{ matrix_beeper_linkedin_docker_src_files_path }}", when: "{{ matrix_beeper_linkedin_container_image_self_build }}"} - {path: "{{ matrix_beeper_linkedin_docker_src_files_path }}", when: "{{ matrix_beeper_linkedin_container_image_self_build }}"}
when: "item.when|bool" when: "item.when | bool"
- name: Ensure Beeper LinkedIn image is pulled - name: Ensure Beeper LinkedIn image is pulled
@ -28,7 +28,7 @@
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_beeper_linkedin_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" force_source: "{{ matrix_beeper_linkedin_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_beeper_linkedin_docker_image_force_pull }}" force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_beeper_linkedin_docker_image_force_pull }}"
when: "not matrix_beeper_linkedin_container_image_self_build|bool" when: "not matrix_beeper_linkedin_container_image_self_build | bool"
register: result register: result
retries: "{{ matrix_container_retries_count }}" retries: "{{ matrix_container_retries_count }}"
delay: "{{ matrix_container_retries_delay }}" delay: "{{ matrix_container_retries_delay }}"
@ -69,11 +69,11 @@
pull: true pull: true
args: args:
TARGETARCH: "{{ matrix_architecture }}" TARGETARCH: "{{ matrix_architecture }}"
when: "matrix_beeper_linkedin_container_image_self_build|bool" when: "matrix_beeper_linkedin_container_image_self_build | bool"
- name: Ensure beeper-linkedin config.yaml installed - name: Ensure beeper-linkedin config.yaml installed
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_beeper_linkedin_configuration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_beeper_linkedin_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_beeper_linkedin_config_path }}/config.yaml" dest: "{{ matrix_beeper_linkedin_config_path }}/config.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -81,7 +81,7 @@
- name: Ensure beeper-linkedin registration.yaml installed - name: Ensure beeper-linkedin registration.yaml installed
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_beeper_linkedin_registration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_beeper_linkedin_registration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_beeper_linkedin_config_path }}/registration.yaml" dest: "{{ matrix_beeper_linkedin_config_path }}/registration.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"

View file

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

View file

@ -101,11 +101,11 @@ matrix_go_skype_bridge_configuration_extension_yaml: |
# If you need something more special, you can take full control by # If you need something more special, you can take full control by
# completely redefining `matrix_go_skype_bridge_configuration_yaml`. # completely redefining `matrix_go_skype_bridge_configuration_yaml`.
matrix_go_skype_bridge_configuration_extension: "{{ matrix_go_skype_bridge_configuration_extension_yaml|from_yaml if matrix_go_skype_bridge_configuration_extension_yaml|from_yaml is mapping else {} }}" matrix_go_skype_bridge_configuration_extension: "{{ matrix_go_skype_bridge_configuration_extension_yaml | from_yaml if matrix_go_skype_bridge_configuration_extension_yaml | from_yaml is mapping else {} }}"
# Holds the final configuration (a combination of the default and its extension). # 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_go_skype_bridge_configuration_yaml`. # You most likely don't need to touch this variable. Instead, see `matrix_go_skype_bridge_configuration_yaml`.
matrix_go_skype_bridge_configuration: "{{ matrix_go_skype_bridge_configuration_yaml|from_yaml|combine(matrix_go_skype_bridge_configuration_extension, recursive=True) }}" matrix_go_skype_bridge_configuration: "{{ matrix_go_skype_bridge_configuration_yaml | from_yaml|combine(matrix_go_skype_bridge_configuration_extension, recursive=True) }}"
matrix_go_skype_bridge_registration_yaml: | matrix_go_skype_bridge_registration_yaml: |
id: skype id: skype
@ -123,7 +123,7 @@ matrix_go_skype_bridge_registration_yaml: |
regex: '^@{{ matrix_go_skype_bridge_appservice_bot_username|regex_escape }}:{{ matrix_go_skype_bridge_homeserver_domain|regex_escape }}$' regex: '^@{{ matrix_go_skype_bridge_appservice_bot_username|regex_escape }}:{{ matrix_go_skype_bridge_homeserver_domain|regex_escape }}$'
de.sorunome.msc2409.push_ephemeral: true de.sorunome.msc2409.push_ephemeral: true
matrix_go_skype_bridge_registration: "{{ matrix_go_skype_bridge_registration_yaml|from_yaml }}" matrix_go_skype_bridge_registration: "{{ matrix_go_skype_bridge_registration_yaml | from_yaml }}"
# Enable End-to-bridge encryption # Enable End-to-bridge encryption
matrix_go_skype_bridge_bridge_encryption_allow: false matrix_go_skype_bridge_bridge_encryption_allow: false

View file

@ -1,21 +1,21 @@
--- ---
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-go-skype-bridge.service'] }}" matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-go-skype-bridge.service'] }}"
when: matrix_go_skype_bridge_enabled|bool when: matrix_go_skype_bridge_enabled | bool
# If the matrix-synapse role is not used, these variables may not exist. # If the matrix-synapse role is not used, these variables may not exist.
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_synapse_container_extra_arguments: > matrix_synapse_container_extra_arguments: >
{{ {{
matrix_synapse_container_extra_arguments|default([]) matrix_synapse_container_extra_arguments | default([])
+ +
["--mount type=bind,src={{ matrix_go_skype_bridge_config_path }}/registration.yaml,dst=/matrix-go-skype-bridge-registration.yaml,ro"] ["--mount type=bind,src={{ matrix_go_skype_bridge_config_path }}/registration.yaml,dst=/matrix-go-skype-bridge-registration.yaml,ro"]
}} }}
matrix_synapse_app_service_config_files: > matrix_synapse_app_service_config_files: >
{{ {{
matrix_synapse_app_service_config_files|default([]) matrix_synapse_app_service_config_files | default([])
+ +
["/matrix-go-skype-bridge-registration.yaml"] ["/matrix-go-skype-bridge-registration.yaml"]
}} }}
when: matrix_go_skype_bridge_enabled|bool when: matrix_go_skype_bridge_enabled | bool

View file

@ -1,23 +1,23 @@
--- ---
- import_tasks: "{{ role_path }}/tasks/init.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
tags: tags:
- always - always
- import_tasks: "{{ role_path }}/tasks/validate_config.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup|bool and matrix_go_skype_bridge_enabled|bool" when: "run_setup | bool and matrix_go_skype_bridge_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-go-skype-bridge - setup-go-skype-bridge
- import_tasks: "{{ role_path }}/tasks/setup_install.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup|bool and matrix_go_skype_bridge_enabled|bool" when: "run_setup | bool and matrix_go_skype_bridge_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-go-skype-bridge - setup-go-skype-bridge
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup|bool and not matrix_go_skype_bridge_enabled|bool" when: "run_setup | bool and not matrix_go_skype_bridge_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-go-skype-bridge - setup-go-skype-bridge

View file

@ -6,14 +6,14 @@
ansible.builtin.fail: ansible.builtin.fail:
msg: >- msg: >-
The matrix-bridge-go-skype-bridge role needs to execute before the matrix-synapse role. The matrix-bridge-go-skype-bridge 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: - ansible.builtin.set_fact:
matrix_go_skype_bridge_requires_restart: false matrix_go_skype_bridge_requires_restart: false
- block: - block:
- name: Check if an SQLite database already exists - name: Check if an SQLite database already exists
stat: ansible.builtin.stat:
path: "{{ matrix_go_skype_bridge_sqlite_database_path_local }}" path: "{{ matrix_go_skype_bridge_sqlite_database_path_local }}"
register: matrix_go_skype_bridge_sqlite_database_path_local_stat_result register: matrix_go_skype_bridge_sqlite_database_path_local_stat_result
@ -22,17 +22,17 @@
matrix_postgres_db_migration_request: matrix_postgres_db_migration_request:
src: "{{ matrix_go_skype_bridge_sqlite_database_path_local }}" src: "{{ matrix_go_skype_bridge_sqlite_database_path_local }}"
dst: "{{ matrix_go_skype_bridge_database_connection_string }}" dst: "{{ matrix_go_skype_bridge_database_connection_string }}"
caller: "{{ role_path|basename }}" caller: "{{ role_path | basename }}"
engine_variable_name: 'matrix_go_skype_bridge_database_engine' engine_variable_name: 'matrix_go_skype_bridge_database_engine'
engine_old: 'sqlite' engine_old: 'sqlite'
systemd_services_to_stop: ['matrix-go-skype-bridge.service'] systemd_services_to_stop: ['matrix-go-skype-bridge.service']
pgloader_options: ['--with "quote identifiers"'] pgloader_options: ['--with "quote identifiers"']
- 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: - ansible.builtin.set_fact:
matrix_go_skype_bridge_requires_restart: true matrix_go_skype_bridge_requires_restart: true
when: "matrix_go_skype_bridge_sqlite_database_path_local_stat_result.stat.exists|bool" when: "matrix_go_skype_bridge_sqlite_database_path_local_stat_result.stat.exists | bool"
when: "matrix_go_skype_bridge_database_engine == 'postgres'" when: "matrix_go_skype_bridge_database_engine == 'postgres'"
@ -48,7 +48,7 @@
- {path: "{{ matrix_go_skype_bridge_config_path }}", when: true} - {path: "{{ matrix_go_skype_bridge_config_path }}", when: true}
- {path: "{{ matrix_go_skype_bridge_data_path }}", when: true} - {path: "{{ matrix_go_skype_bridge_data_path }}", when: true}
- {path: "{{ matrix_go_skype_bridge_docker_src_files_path }}", when: "{{ matrix_go_skype_bridge_container_image_self_build }}"} - {path: "{{ matrix_go_skype_bridge_docker_src_files_path }}", when: "{{ matrix_go_skype_bridge_container_image_self_build }}"}
when: item.when|bool when: item.when | bool
- name: Ensure Go Skype Bridge image is pulled - name: Ensure Go Skype Bridge image is pulled
docker_image: docker_image:
@ -71,7 +71,7 @@
become: true become: true
become_user: "{{ matrix_user_username }}" become_user: "{{ matrix_user_username }}"
register: matrix_go_skype_bridge_git_pull_results register: matrix_go_skype_bridge_git_pull_results
when: "matrix_go_skype_bridge_container_image_self_build|bool" when: "matrix_go_skype_bridge_container_image_self_build | bool"
- name: Ensure Go Skype Bridge Docker image is built - name: Ensure Go Skype Bridge Docker image is built
docker_image: docker_image:
@ -83,15 +83,15 @@
dockerfile: Dockerfile dockerfile: Dockerfile
path: "{{ matrix_go_skype_bridge_docker_src_files_path }}" path: "{{ matrix_go_skype_bridge_docker_src_files_path }}"
pull: true pull: true
when: "matrix_go_skype_bridge_container_image_self_build|bool" when: "matrix_go_skype_bridge_container_image_self_build | bool"
- name: Check if an old database file exists - name: Check if an old database file exists
stat: ansible.builtin.stat:
path: "{{ matrix_go_skype_bridge_base_path }}/go-skype-bridge.db" path: "{{ matrix_go_skype_bridge_base_path }}/go-skype-bridge.db"
register: matrix_go_skype_bridge_stat_database register: matrix_go_skype_bridge_stat_database
- name: Check if an old matrix state file exists - name: Check if an old matrix state file exists
stat: ansible.builtin.stat:
path: "{{ matrix_go_skype_bridge_base_path }}/mx-state.json" path: "{{ matrix_go_skype_bridge_base_path }}/mx-state.json"
register: matrix_go_skype_bridge_stat_mx_state register: matrix_go_skype_bridge_stat_mx_state
@ -114,7 +114,7 @@
- name: Ensure go-skype-bridge config.yaml installed - name: Ensure go-skype-bridge config.yaml installed
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_go_skype_bridge_configuration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_go_skype_bridge_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_go_skype_bridge_config_path }}/config.yaml" dest: "{{ matrix_go_skype_bridge_config_path }}/config.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -122,7 +122,7 @@
- name: Ensure go-skype-bridge registration.yaml installed - name: Ensure go-skype-bridge registration.yaml installed
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_go_skype_bridge_registration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_go_skype_bridge_registration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_go_skype_bridge_config_path }}/registration.yaml" dest: "{{ matrix_go_skype_bridge_config_path }}/registration.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -144,4 +144,4 @@
ansible.builtin.service: ansible.builtin.service:
name: "matrix-go-skype-bridge.service" name: "matrix-go-skype-bridge.service"
state: restarted state: restarted
when: "matrix_go_skype_bridge_requires_restart|bool" when: "matrix_go_skype_bridge_requires_restart | bool"

View file

@ -1,7 +1,7 @@
--- ---
- name: Check existence of matrix-go-skype-bridge service - name: Check existence of matrix-go-skype-bridge service
stat: ansible.builtin.stat:
path: "/etc/systemd/system/matrix-go-skype-bridge.service" path: "/etc/systemd/system/matrix-go-skype-bridge.service"
register: matrix_go_skype_bridge_service_stat register: matrix_go_skype_bridge_service_stat

View file

@ -45,4 +45,4 @@ matrix_heisenbridge_registration_yaml:
aliases: [] aliases: []
rooms: [] rooms: []
matrix_heisenbridge_registration: "{{ matrix_heisenbridge_registration_yaml|from_yaml }}" matrix_heisenbridge_registration: "{{ matrix_heisenbridge_registration_yaml | from_yaml }}"

View file

@ -5,25 +5,25 @@
ansible.builtin.fail: ansible.builtin.fail:
msg: >- msg: >-
The matrix-bridge-heisenbridge role needs to execute before the matrix-synapse role. The matrix-bridge-heisenbridge role needs to execute before the matrix-synapse role.
when: "matrix_heisenbridge_enabled and matrix_synapse_role_executed|default(False)" when: "matrix_heisenbridge_enabled and matrix_synapse_role_executed | default(False)"
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-heisenbridge.service'] }}" matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-heisenbridge.service'] }}"
when: matrix_heisenbridge_enabled|bool when: matrix_heisenbridge_enabled | bool
# If the matrix-synapse role is not used, these variables may not exist. # If the matrix-synapse role is not used, these variables may not exist.
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_synapse_container_extra_arguments: > matrix_synapse_container_extra_arguments: >
{{ {{
matrix_synapse_container_extra_arguments|default([]) matrix_synapse_container_extra_arguments | default([])
+ +
["--mount type=bind,src={{ matrix_heisenbridge_base_path }}/registration.yaml,dst=/heisenbridge-registration.yaml,ro"] ["--mount type=bind,src={{ matrix_heisenbridge_base_path }}/registration.yaml,dst=/heisenbridge-registration.yaml,ro"]
}} }}
matrix_synapse_app_service_config_files: > matrix_synapse_app_service_config_files: >
{{ {{
matrix_synapse_app_service_config_files|default([]) matrix_synapse_app_service_config_files | default([])
+ +
["/heisenbridge-registration.yaml"] ["/heisenbridge-registration.yaml"]
}} }}
when: matrix_heisenbridge_enabled|bool when: matrix_heisenbridge_enabled | bool

View file

@ -1,17 +1,17 @@
--- ---
- import_tasks: "{{ role_path }}/tasks/init.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
tags: tags:
- always - always
- import_tasks: "{{ role_path }}/tasks/setup_install.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup|bool and matrix_heisenbridge_enabled|bool" when: "run_setup | bool and matrix_heisenbridge_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-heisenbridge - setup-heisenbridge
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup|bool and not matrix_heisenbridge_enabled|bool" when: "run_setup | bool and not matrix_heisenbridge_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-heisenbridge - setup-heisenbridge

View file

@ -23,7 +23,7 @@
- name: Ensure heisenbridge registration.yaml installed if provided - name: Ensure heisenbridge registration.yaml installed if provided
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_heisenbridge_registration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_heisenbridge_registration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_heisenbridge_base_path }}/registration.yaml" dest: "{{ matrix_heisenbridge_base_path }}/registration.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"

View file

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

View file

@ -233,11 +233,11 @@ matrix_hookshot_configuration_extension_yaml: |
# If you need something more special, you can take full control by # If you need something more special, you can take full control by
# completely redefining `matrix_hookshot_configuration_yaml`. # completely redefining `matrix_hookshot_configuration_yaml`.
matrix_hookshot_configuration_extension: "{{ matrix_hookshot_configuration_extension_yaml|from_yaml if matrix_hookshot_configuration_extension_yaml|from_yaml is mapping else {} }}" matrix_hookshot_configuration_extension: "{{ matrix_hookshot_configuration_extension_yaml | from_yaml if matrix_hookshot_configuration_extension_yaml | from_yaml is mapping else {} }}"
# Holds the final configuration (a combination of the default and its extension). # 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_hookshot_configuration_yaml`. # You most likely don't need to touch this variable. Instead, see `matrix_hookshot_configuration_yaml`.
matrix_hookshot_configuration: "{{ matrix_hookshot_configuration_yaml|from_yaml|combine(matrix_hookshot_configuration_extension, recursive=True) }}" matrix_hookshot_configuration: "{{ matrix_hookshot_configuration_yaml | from_yaml|combine(matrix_hookshot_configuration_extension, recursive=True) }}"
# Default registration template which covers the generic use case. # Default registration template which covers the generic use case.
# You can customize it by controlling the various variables inside it. # You can customize it by controlling the various variables inside it.
@ -255,8 +255,8 @@ matrix_hookshot_registration_extension_yaml: |
# If you need something more special, you can take full control by # If you need something more special, you can take full control by
# completely redefining `matrix_hookshot_registration_yaml`. # completely redefining `matrix_hookshot_registration_yaml`.
matrix_hookshot_registration_extension: "{{ matrix_hookshot_registration_extension_yaml|from_yaml if matrix_hookshot_registration_extension_yaml|from_yaml is mapping else {} }}" matrix_hookshot_registration_extension: "{{ matrix_hookshot_registration_extension_yaml | from_yaml if matrix_hookshot_registration_extension_yaml | from_yaml is mapping else {} }}"
# Holds the final registration (a combination of the default and its extension). # Holds the final registration (a combination of the default and its extension).
# You most likely don't need to touch this variable. Instead, see `matrix_hookshot_registration_yaml`. # You most likely don't need to touch this variable. Instead, see `matrix_hookshot_registration_yaml`.
matrix_hookshot_registration: "{{ matrix_hookshot_registration_yaml|from_yaml|combine(matrix_hookshot_registration_extension, recursive=True) }}" matrix_hookshot_registration: "{{ matrix_hookshot_registration_yaml | from_yaml|combine(matrix_hookshot_registration_extension, recursive=True) }}"

View file

@ -5,28 +5,28 @@
ansible.builtin.fail: ansible.builtin.fail:
msg: >- msg: >-
The matrix-bridge-hookshot role needs to execute before the matrix-synapse role. The matrix-bridge-hookshot role needs to execute before the matrix-synapse role.
when: "matrix_hookshot_enabled and matrix_synapse_role_executed|default(False)" when: "matrix_hookshot_enabled and matrix_synapse_role_executed | default(False)"
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-hookshot.service'] }}" matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-hookshot.service'] }}"
when: matrix_hookshot_enabled|bool when: matrix_hookshot_enabled | bool
# If the matrix-synapse role is not used, these variables may not exist. # If the matrix-synapse role is not used, these variables may not exist.
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_synapse_container_extra_arguments: > matrix_synapse_container_extra_arguments: >
{{ {{
matrix_synapse_container_extra_arguments|default([]) matrix_synapse_container_extra_arguments | default([])
+ +
["--mount type=bind,src={{ matrix_hookshot_base_path }}/registration.yml,dst=/hookshot-registration.yml,ro"] ["--mount type=bind,src={{ matrix_hookshot_base_path }}/registration.yml,dst=/hookshot-registration.yml,ro"]
}} }}
matrix_synapse_app_service_config_files: > matrix_synapse_app_service_config_files: >
{{ {{
matrix_synapse_app_service_config_files|default([]) matrix_synapse_app_service_config_files | default([])
+ +
["/hookshot-registration.yml"] ["/hookshot-registration.yml"]
}} }}
when: matrix_hookshot_enabled|bool when: matrix_hookshot_enabled | bool
- block: - block:
- name: Fail if matrix-nginx-proxy role already executed - name: Fail if matrix-nginx-proxy role already executed
@ -36,13 +36,13 @@
but it's pointless since the matrix-nginx-proxy role had already executed. 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, 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-hookshot role. so that the matrix-nginx-proxy role would run after the matrix-bridge-hookshot role.
when: matrix_nginx_proxy_role_executed|default(False)|bool when: matrix_nginx_proxy_role_executed | default(False) | bool
- name: Generate Matrix hookshot proxying configuration for matrix-nginx-proxy - name: Generate Matrix hookshot proxying configuration for matrix-nginx-proxy
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_hookshot_matrix_nginx_proxy_configuration: | matrix_hookshot_matrix_nginx_proxy_configuration: |
location ~ ^{{ matrix_hookshot_appservice_endpoint }}/(.*)$ { location ~ ^{{ matrix_hookshot_appservice_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 #} {# Use the embedded DNS resolver in Docker containers to discover the service #}
resolver 127.0.0.11 valid=5s; resolver 127.0.0.11 valid=5s;
set $backend "{{ matrix_hookshot_container_url }}:{{ matrix_hookshot_appservice_port }}"; set $backend "{{ matrix_hookshot_container_url }}:{{ matrix_hookshot_appservice_port }}";
@ -55,7 +55,7 @@
} }
{% if matrix_hookshot_provisioning_enabled %} {% if matrix_hookshot_provisioning_enabled %}
location ~ ^{{ matrix_hookshot_provisioning_endpoint }}/(.*)$ { location ~ ^{{ matrix_hookshot_provisioning_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 #} {# Use the embedded DNS resolver in Docker containers to discover the service #}
resolver 127.0.0.11 valid=5s; resolver 127.0.0.11 valid=5s;
set $backend "{{ matrix_hookshot_container_url }}:{{ matrix_hookshot_provisioning_port }}"; set $backend "{{ matrix_hookshot_container_url }}:{{ matrix_hookshot_provisioning_port }}";
@ -69,7 +69,7 @@
{% endif %} {% endif %}
{% if matrix_hookshot_widgets_enabled %} {% if matrix_hookshot_widgets_enabled %}
location ~ ^{{ matrix_hookshot_widgets_endpoint }}/(.*)$ { location ~ ^{{ matrix_hookshot_widgets_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 #} {# Use the embedded DNS resolver in Docker containers to discover the service #}
resolver 127.0.0.11 valid=5s; resolver 127.0.0.11 valid=5s;
set $backend "{{ matrix_hookshot_container_url }}:{{ matrix_hookshot_widgets_port }}"; set $backend "{{ matrix_hookshot_container_url }}:{{ matrix_hookshot_widgets_port }}";
@ -82,7 +82,7 @@
} }
{% endif %} {% endif %}
location ~ ^{{ matrix_hookshot_webhook_endpoint }}/(.*)$ { location ~ ^{{ matrix_hookshot_webhook_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 #} {# Use the embedded DNS resolver in Docker containers to discover the service #}
resolver 127.0.0.11 valid=5s; resolver 127.0.0.11 valid=5s;
set $backend "{{ matrix_hookshot_container_url }}:{{ matrix_hookshot_webhook_port }}"; set $backend "{{ matrix_hookshot_container_url }}:{{ matrix_hookshot_webhook_port }}";
@ -98,7 +98,7 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | 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_hookshot_matrix_nginx_proxy_configuration] [matrix_hookshot_matrix_nginx_proxy_configuration]
}} }}
@ -107,7 +107,7 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_hookshot_matrix_nginx_proxy_metrics_configuration_matrix_domain: | matrix_hookshot_matrix_nginx_proxy_metrics_configuration_matrix_domain: |
location /metrics/hookshot { location /metrics/hookshot {
{% 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 #} {# Use the embedded DNS resolver in Docker containers to discover the service #}
resolver 127.0.0.11 valid=5s; resolver 127.0.0.11 valid=5s;
set $backend "{{ matrix_hookshot_container_url }}:{{ matrix_hookshot_metrics_port }}"; set $backend "{{ matrix_hookshot_container_url }}:{{ matrix_hookshot_metrics_port }}";
@ -117,18 +117,18 @@
proxy_pass http://127.0.0.1:{{ matrix_hookshot_metrics_port }}/metrics; proxy_pass http://127.0.0.1:{{ matrix_hookshot_metrics_port }}/metrics;
{% endif %} {% endif %}
} }
when: matrix_hookshot_metrics_enabled|bool and matrix_hookshot_metrics_proxying_enabled|bool when: matrix_hookshot_metrics_enabled | bool and matrix_hookshot_metrics_proxying_enabled | bool
- name: Register hookshot metrics proxying configuration with matrix-nginx-proxy (matrix.DOMAIN/metrics/hookshot) - name: Register hookshot metrics proxying configuration with matrix-nginx-proxy (matrix.DOMAIN/metrics/hookshot)
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_nginx_proxy_proxy_matrix_metrics_additional_system_location_configuration_blocks: | matrix_nginx_proxy_proxy_matrix_metrics_additional_system_location_configuration_blocks: |
{{ {{
matrix_nginx_proxy_proxy_matrix_metrics_additional_system_location_configuration_blocks|default([]) matrix_nginx_proxy_proxy_matrix_metrics_additional_system_location_configuration_blocks | default([])
+ +
[matrix_hookshot_matrix_nginx_proxy_metrics_configuration_matrix_domain] [matrix_hookshot_matrix_nginx_proxy_metrics_configuration_matrix_domain]
}} }}
when: matrix_hookshot_metrics_enabled|bool and matrix_hookshot_metrics_proxying_enabled|bool when: matrix_hookshot_metrics_enabled | bool and matrix_hookshot_metrics_proxying_enabled | bool
when: matrix_hookshot_enabled|bool when: matrix_hookshot_enabled | bool
- name: Warn about reverse-proxying if matrix-nginx-proxy not used - name: Warn about reverse-proxying if matrix-nginx-proxy not used
ansible.builtin.debug: ansible.builtin.debug:
@ -138,4 +138,4 @@
Please make sure that you're proxying the `{{ matrix_hookshot_public_endpoint }}` Please make sure that you're proxying the `{{ matrix_hookshot_public_endpoint }}`
URL endpoint to the matrix-hookshot container. URL endpoint to the matrix-hookshot container.
You can expose the container's ports using the `matrix_hookshot_container_http_host_bind_ports` variable. You can expose the container's ports using the `matrix_hookshot_container_http_host_bind_ports` variable.
when: "matrix_hookshot_enabled|bool and not matrix_nginx_proxy_enabled|default(False)|bool" when: "matrix_hookshot_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: tags:
- always - always
- import_tasks: "{{ role_path }}/tasks/validate_config.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup|bool and matrix_hookshot_enabled|bool" when: "run_setup | bool and matrix_hookshot_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-hookshot - setup-hookshot
- import_tasks: "{{ role_path }}/tasks/setup_install.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup|bool and matrix_hookshot_enabled|bool" when: "run_setup | bool and matrix_hookshot_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-hookshot - setup-hookshot
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup|bool and not matrix_hookshot_enabled|bool" when: "run_setup | bool and not matrix_hookshot_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-hookshot - setup-hookshot

View file

@ -1,6 +1,6 @@
--- ---
- import_tasks: "{{ role_path }}/../matrix-base/tasks/util/ensure_openssl_installed.yml" - ansible.builtin.import_tasks: "{{ role_path }}/../matrix-base/tasks/util/ensure_openssl_installed.yml"
- name: Ensure hookshot paths exist - name: Ensure hookshot paths exist
ansible.builtin.file: ansible.builtin.file:
@ -12,7 +12,7 @@
with_items: with_items:
- {path: "{{ matrix_hookshot_base_path }}", when: true} - {path: "{{ matrix_hookshot_base_path }}", when: true}
- {path: "{{ matrix_hookshot_docker_src_files_path }}", when: "{{ matrix_hookshot_container_image_self_build }}"} - {path: "{{ matrix_hookshot_docker_src_files_path }}", when: "{{ matrix_hookshot_container_image_self_build }}"}
when: item.when|bool when: item.when | bool
- name: Ensure hookshot image is pulled - name: Ensure hookshot image is pulled
docker_image: docker_image:
@ -35,7 +35,7 @@
become: true become: true
become_user: "{{ matrix_user_username }}" become_user: "{{ matrix_user_username }}"
register: matrix_hookshot_git_pull_results register: matrix_hookshot_git_pull_results
when: "matrix_hookshot_container_image_self_build|bool" when: "matrix_hookshot_container_image_self_build | bool"
- name: Ensure hookshot Docker image is built - name: Ensure hookshot Docker image is built
docker_image: docker_image:
@ -47,10 +47,10 @@
dockerfile: Dockerfile dockerfile: Dockerfile
path: "{{ matrix_hookshot_docker_src_files_path }}" path: "{{ matrix_hookshot_docker_src_files_path }}"
pull: true pull: true
when: "matrix_hookshot_container_image_self_build|bool" when: "matrix_hookshot_container_image_self_build | bool"
- name: Check if hookshot passkey exists - name: Check if hookshot passkey exists
stat: ansible.builtin.stat:
path: "{{ matrix_hookshot_base_path }}/passkey.pem" path: "{{ matrix_hookshot_base_path }}/passkey.pem"
register: hookshot_passkey_file register: hookshot_passkey_file
@ -62,7 +62,7 @@
- name: Ensure hookshot config.yml installed if provided - name: Ensure hookshot config.yml installed if provided
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_hookshot_configuration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_hookshot_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_hookshot_base_path }}/config.yml" dest: "{{ matrix_hookshot_base_path }}/config.yml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -86,7 +86,7 @@
- name: Ensure hookshot registration.yml installed if provided - name: Ensure hookshot registration.yml installed if provided
ansible.builtin.copy: ansible.builtin.copy:
content: "{{ matrix_hookshot_registration|to_nice_yaml(indent=2, width=999999) }}" content: "{{ matrix_hookshot_registration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ matrix_hookshot_base_path }}/registration.yml" dest: "{{ matrix_hookshot_base_path }}/registration.yml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -99,7 +99,7 @@
mode: 0400 mode: 0400
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}" group: "{{ matrix_user_groupname }}"
when: matrix_hookshot_github_enabled|bool and matrix_hookshot_github_private_key|length > 0 when: matrix_hookshot_github_enabled | bool and matrix_hookshot_github_private_key|length > 0
- name: Ensure matrix-hookshot.service installed - name: Ensure matrix-hookshot.service installed
ansible.builtin.template: ansible.builtin.template:

View file

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

View file

@ -110,11 +110,11 @@ matrix_mautrix_facebook_configuration_extension_yaml: |
# If you need something more special, you can take full control by # If you need something more special, you can take full control by
# completely redefining `matrix_mautrix_facebook_configuration_yaml`. # completely redefining `matrix_mautrix_facebook_configuration_yaml`.
matrix_mautrix_facebook_configuration_extension: "{{ matrix_mautrix_facebook_configuration_extension_yaml|from_yaml if matrix_mautrix_facebook_configuration_extension_yaml|from_yaml is mapping else {} }}" matrix_mautrix_facebook_configuration_extension: "{{ matrix_mautrix_facebook_configuration_extension_yaml | from_yaml if matrix_mautrix_facebook_configuration_extension_yaml | from_yaml is mapping else {} }}"
# Holds the final configuration (a combination of the default and its extension). # 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_facebook_configuration_yaml`. # You most likely don't need to touch this variable. Instead, see `matrix_mautrix_facebook_configuration_yaml`.
matrix_mautrix_facebook_configuration: "{{ matrix_mautrix_facebook_configuration_yaml|from_yaml|combine(matrix_mautrix_facebook_configuration_extension, recursive=True) }}" matrix_mautrix_facebook_configuration: "{{ matrix_mautrix_facebook_configuration_yaml | from_yaml|combine(matrix_mautrix_facebook_configuration_extension, recursive=True) }}"
matrix_mautrix_facebook_registration_yaml: | matrix_mautrix_facebook_registration_yaml: |
id: facebook id: facebook
@ -132,4 +132,4 @@ matrix_mautrix_facebook_registration_yaml: |
rate_limited: false rate_limited: false
de.sorunome.msc2409.push_ephemeral: true de.sorunome.msc2409.push_ephemeral: true
matrix_mautrix_facebook_registration: "{{ matrix_mautrix_facebook_registration_yaml|from_yaml }}" matrix_mautrix_facebook_registration: "{{ matrix_mautrix_facebook_registration_yaml | from_yaml }}"

View file

@ -8,24 +8,24 @@
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-mautrix-facebook.service'] }}" 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. # If the matrix-synapse role is not used, these variables may not exist.
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_synapse_container_extra_arguments: > 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"] ["--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: >
{{ {{
matrix_synapse_app_service_config_files|default([]) matrix_synapse_app_service_config_files | default([])
+ +
["/matrix-mautrix-facebook-registration.yaml"] ["/matrix-mautrix-facebook-registration.yaml"]
}} }}
when: matrix_mautrix_facebook_enabled|bool when: matrix_mautrix_facebook_enabled | bool
- block: - block:
- name: Fail if matrix-nginx-proxy role already executed - 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. 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, 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. 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 - name: Generate Mautrix Facebook proxying configuration for matrix-nginx-proxy
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_mautrix_facebook_matrix_nginx_proxy_configuration: | matrix_mautrix_facebook_matrix_nginx_proxy_configuration: |
location {{ matrix_mautrix_facebook_public_endpoint }} { 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 #} {# Use the embedded DNS resolver in Docker containers to discover the service #}
resolver 127.0.0.11 valid=5s; resolver 127.0.0.11 valid=5s;
set $backend "matrix-mautrix-facebook:29319"; set $backend "matrix-mautrix-facebook:29319";
@ -56,7 +56,7 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | 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] [matrix_mautrix_facebook_matrix_nginx_proxy_configuration]
}} }}
@ -69,8 +69,8 @@
Please make sure that you're proxying the `{{ matrix_mautrix_facebook_public_endpoint }}` Please make sure that you're proxying the `{{ matrix_mautrix_facebook_public_endpoint }}`
URL endpoint to the matrix-mautrix-facebook container. 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. 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: tags:
- always - 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

View file

@ -1,23 +1,23 @@
--- ---
- import_tasks: "{{ role_path }}/tasks/init.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
tags: tags:
- always - always
- import_tasks: "{{ role_path }}/tasks/validate_config.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup|bool and matrix_mautrix_facebook_enabled|bool" when: "run_setup | bool and matrix_mautrix_facebook_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-mautrix-facebook - setup-mautrix-facebook
- import_tasks: "{{ role_path }}/tasks/setup_install.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup|bool and matrix_mautrix_facebook_enabled|bool" when: "run_setup | bool and matrix_mautrix_facebook_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-mautrix-facebook - setup-mautrix-facebook
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup|bool and not matrix_mautrix_facebook_enabled|bool" when: "run_setup | bool and not matrix_mautrix_facebook_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-mautrix-facebook - setup-mautrix-facebook

View file

@ -6,14 +6,14 @@
ansible.builtin.fail: ansible.builtin.fail:
msg: >- msg: >-
The matrix-bridge-mautrix-facebook role needs to execute before the matrix-synapse role. 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: - ansible.builtin.set_fact:
matrix_mautrix_facebook_requires_restart: false matrix_mautrix_facebook_requires_restart: false
- block: - block:
- name: Check if an SQLite database already exists - name: Check if an SQLite database already exists
stat: ansible.builtin.stat:
path: "{{ matrix_mautrix_facebook_sqlite_database_path_local }}" path: "{{ matrix_mautrix_facebook_sqlite_database_path_local }}"
register: matrix_mautrix_facebook_sqlite_database_path_local_stat_result register: matrix_mautrix_facebook_sqlite_database_path_local_stat_result
@ -22,16 +22,16 @@
matrix_postgres_db_migration_request: matrix_postgres_db_migration_request:
src: "{{ matrix_mautrix_facebook_sqlite_database_path_local }}" src: "{{ matrix_mautrix_facebook_sqlite_database_path_local }}"
dst: "{{ matrix_mautrix_facebook_database_connection_string }}" dst: "{{ matrix_mautrix_facebook_database_connection_string }}"
caller: "{{ role_path|basename }}" caller: "{{ role_path | basename }}"
engine_variable_name: 'matrix_mautrix_facebook_database_engine' engine_variable_name: 'matrix_mautrix_facebook_database_engine'
engine_old: 'sqlite' engine_old: 'sqlite'
systemd_services_to_stop: ['matrix-mautrix-facebook.service'] 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: - ansible.builtin.set_fact:
matrix_mautrix_facebook_requires_restart: true 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'" when: "matrix_mautrix_facebook_database_engine == 'postgres'"
- name: Ensure Mautrix Facebook image is pulled - name: Ensure Mautrix Facebook image is pulled
@ -58,7 +58,7 @@
- {path: "{{ matrix_mautrix_facebook_config_path }}", when: true} - {path: "{{ matrix_mautrix_facebook_config_path }}", when: true}
- {path: "{{ matrix_mautrix_facebook_data_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 }}"} - {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 - name: Ensure Mautrix Facebook repository is present on self-build
ansible.builtin.git: ansible.builtin.git:
@ -69,7 +69,7 @@
become: true become: true
become_user: "{{ matrix_user_username }}" become_user: "{{ matrix_user_username }}"
register: matrix_mautrix_facebook_git_pull_results 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 - name: Ensure Mautrix Facebook Docker image is built
docker_image: docker_image:
@ -81,10 +81,10 @@
dockerfile: Dockerfile dockerfile: Dockerfile
path: "{{ matrix_mautrix_facebook_docker_src_files_path }}" path: "{{ matrix_mautrix_facebook_docker_src_files_path }}"
pull: true 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 - name: Check if an old database file already exists
stat: ansible.builtin.stat:
path: "{{ matrix_mautrix_facebook_base_path }}/mautrix-facebook.db" path: "{{ matrix_mautrix_facebook_base_path }}/mautrix-facebook.db"
register: matrix_mautrix_facebook_stat_database register: matrix_mautrix_facebook_stat_database
@ -103,7 +103,7 @@
- name: Ensure mautrix-facebook config.yaml installed - name: Ensure mautrix-facebook config.yaml installed
ansible.builtin.copy: 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" dest: "{{ matrix_mautrix_facebook_config_path }}/config.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -111,7 +111,7 @@
- name: Ensure mautrix-facebook registration.yaml installed - name: Ensure mautrix-facebook registration.yaml installed
ansible.builtin.copy: 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" dest: "{{ matrix_mautrix_facebook_config_path }}/registration.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -133,4 +133,4 @@
ansible.builtin.service: ansible.builtin.service:
name: "matrix-mautrix-facebook.service" name: "matrix-mautrix-facebook.service"
state: restarted state: restarted
when: "matrix_mautrix_facebook_requires_restart|bool" when: "matrix_mautrix_facebook_requires_restart | bool"

View file

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

View file

@ -15,7 +15,7 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_playbook_runtime_results: | 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)" "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)"

View file

@ -99,11 +99,11 @@ matrix_mautrix_googlechat_configuration_extension_yaml: |
# If you need something more special, you can take full control by # If you need something more special, you can take full control by
# completely redefining `matrix_mautrix_googlechat_configuration_yaml`. # 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). # 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`. # 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: | matrix_mautrix_googlechat_registration_yaml: |
id: googlechat id: googlechat
@ -121,4 +121,4 @@ matrix_mautrix_googlechat_registration_yaml: |
rate_limited: false rate_limited: false
de.sorunome.msc2409.push_ephemeral: true 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: - ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-mautrix-googlechat.service'] }}" 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. # If the matrix-synapse role is not used, these variables may not exist.
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_synapse_container_extra_arguments: > 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"] ["--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: >
{{ {{
matrix_synapse_app_service_config_files|default([]) matrix_synapse_app_service_config_files | default([])
+ +
["/matrix-mautrix-googlechat-registration.yaml"] ["/matrix-mautrix-googlechat-registration.yaml"]
}} }}
when: matrix_mautrix_googlechat_enabled|bool when: matrix_mautrix_googlechat_enabled | bool
- block: - block:
- name: Fail if matrix-nginx-proxy role already executed - 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. 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, 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. 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 - name: Generate Mautrix googlechat proxying configuration for matrix-nginx-proxy
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_mautrix_googlechat_matrix_nginx_proxy_configuration: | matrix_mautrix_googlechat_matrix_nginx_proxy_configuration: |
location {{ matrix_mautrix_googlechat_public_endpoint }} { 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 #} {# Use the embedded DNS resolver in Docker containers to discover the service #}
resolver 127.0.0.11 valid=5s; resolver 127.0.0.11 valid=5s;
set $backend "matrix-mautrix-googlechat:8080"; set $backend "matrix-mautrix-googlechat:8080";
@ -55,13 +55,13 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | 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] [matrix_mautrix_googlechat_matrix_nginx_proxy_configuration]
}} }}
tags: tags:
- always - always
when: matrix_mautrix_googlechat_enabled|bool when: matrix_mautrix_googlechat_enabled | bool
- name: Warn about reverse-proxying if matrix-nginx-proxy not used - name: Warn about reverse-proxying if matrix-nginx-proxy not used
ansible.builtin.debug: ansible.builtin.debug:
@ -71,4 +71,4 @@
Please make sure that you're proxying the `{{ matrix_mautrix_googlechat_public_endpoint }}` Please make sure that you're proxying the `{{ matrix_mautrix_googlechat_public_endpoint }}`
URL endpoint to the matrix-mautrix-googlechat container. 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. 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: tags:
- always - always
- import_tasks: "{{ role_path }}/tasks/validate_config.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
when: "run_setup|bool and matrix_mautrix_googlechat_enabled|bool" when: "run_setup | bool and matrix_mautrix_googlechat_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-mautrix-googlechat - setup-mautrix-googlechat
- import_tasks: "{{ role_path }}/tasks/setup_install.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
when: "run_setup|bool and matrix_mautrix_googlechat_enabled|bool" when: "run_setup | bool and matrix_mautrix_googlechat_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-mautrix-googlechat - setup-mautrix-googlechat
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" - ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
when: "run_setup|bool and not matrix_mautrix_googlechat_enabled|bool" when: "run_setup | bool and not matrix_mautrix_googlechat_enabled | bool"
tags: tags:
- setup-all - setup-all
- setup-mautrix-googlechat - setup-mautrix-googlechat

View file

@ -6,14 +6,14 @@
ansible.builtin.fail: ansible.builtin.fail:
msg: >- msg: >-
The matrix-bridge-mautrix-googlechat role needs to execute before the matrix-synapse role. 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: - ansible.builtin.set_fact:
matrix_mautrix_googlechat_requires_restart: false matrix_mautrix_googlechat_requires_restart: false
- block: - block:
- name: Check if an SQLite database already exists - name: Check if an SQLite database already exists
stat: ansible.builtin.stat:
path: "{{ matrix_mautrix_googlechat_sqlite_database_path_local }}" path: "{{ matrix_mautrix_googlechat_sqlite_database_path_local }}"
register: matrix_mautrix_googlechat_sqlite_database_path_local_stat_result register: matrix_mautrix_googlechat_sqlite_database_path_local_stat_result
@ -22,16 +22,16 @@
matrix_postgres_db_migration_request: matrix_postgres_db_migration_request:
src: "{{ matrix_mautrix_googlechat_sqlite_database_path_local }}" src: "{{ matrix_mautrix_googlechat_sqlite_database_path_local }}"
dst: "{{ matrix_mautrix_googlechat_database_connection_string }}" dst: "{{ matrix_mautrix_googlechat_database_connection_string }}"
caller: "{{ role_path|basename }}" caller: "{{ role_path | basename }}"
engine_variable_name: 'matrix_mautrix_googlechat_database_engine' engine_variable_name: 'matrix_mautrix_googlechat_database_engine'
engine_old: 'sqlite' engine_old: 'sqlite'
systemd_services_to_stop: ['matrix-mautrix-googlechat.service'] 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: - ansible.builtin.set_fact:
matrix_mautrix_googlechat_requires_restart: true 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'" when: "matrix_mautrix_googlechat_database_engine == 'postgres'"
- name: Ensure Mautrix googlechat image is pulled - name: Ensure Mautrix googlechat image is pulled
@ -58,7 +58,7 @@
- {path: "{{ matrix_mautrix_googlechat_config_path }}", when: true} - {path: "{{ matrix_mautrix_googlechat_config_path }}", when: true}
- {path: "{{ matrix_mautrix_googlechat_data_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 }}"} - {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 - name: Ensure Mautrix Hangots repository is present on self build
ansible.builtin.git: ansible.builtin.git:
@ -68,7 +68,7 @@
become: true become: true
become_user: "{{ matrix_user_username }}" become_user: "{{ matrix_user_username }}"
register: matrix_mautrix_googlechat_git_pull_results 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 - name: Ensure Mautrix googlechat Docker image is built
docker_image: docker_image:
@ -80,10 +80,10 @@
dockerfile: Dockerfile dockerfile: Dockerfile
path: "{{ matrix_mautrix_googlechat_docker_src_files_path }}" path: "{{ matrix_mautrix_googlechat_docker_src_files_path }}"
pull: true 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 - name: Check if an old database file already exists
stat: ansible.builtin.stat:
path: "{{ matrix_mautrix_googlechat_base_path }}/mautrix-googlechat.db" path: "{{ matrix_mautrix_googlechat_base_path }}/mautrix-googlechat.db"
register: matrix_mautrix_googlechat_stat_database register: matrix_mautrix_googlechat_stat_database
@ -102,7 +102,7 @@
- name: Ensure mautrix-googlechat config.yaml installed - name: Ensure mautrix-googlechat config.yaml installed
ansible.builtin.copy: 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" dest: "{{ matrix_mautrix_googlechat_config_path }}/config.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -110,7 +110,7 @@
- name: Ensure mautrix-googlechat registration.yaml installed - name: Ensure mautrix-googlechat registration.yaml installed
ansible.builtin.copy: 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" dest: "{{ matrix_mautrix_googlechat_config_path }}/registration.yaml"
mode: 0644 mode: 0644
owner: "{{ matrix_user_username }}" owner: "{{ matrix_user_username }}"
@ -132,4 +132,4 @@
ansible.builtin.service: ansible.builtin.service:
name: "matrix-mautrix-googlechat.service" name: "matrix-mautrix-googlechat.service"
state: restarted 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 - name: Check existence of matrix-mautrix-googlechat service
stat: ansible.builtin.stat:
path: "{{ matrix_systemd_path }}/matrix-mautrix-googlechat.service" path: "{{ matrix_systemd_path }}/matrix-mautrix-googlechat.service"
register: matrix_mautrix_googlechat_service_stat register: matrix_mautrix_googlechat_service_stat

View file

@ -96,11 +96,11 @@ matrix_mautrix_hangouts_configuration_extension_yaml: |
# If you need something more special, you can take full control by # If you need something more special, you can take full control by
# completely redefining `matrix_mautrix_hangouts_configuration_yaml`. # completely redefining `matrix_mautrix_hangouts_configuration_yaml`.
matrix_mautrix_hangouts_configuration_extension: "{{ matrix_mautrix_hangouts_configuration_extension_yaml|from_yaml if matrix_mautrix_hangouts_configuration_extension_yaml|from_yaml is mapping else {} }}" matrix_mautrix_hangouts_configuration_extension: "{{ matrix_mautrix_hangouts_configuration_extension_yaml | from_yaml if matrix_mautrix_hangouts_configuration_extension_yaml | from_yaml is mapping else {} }}"
# Holds the final configuration (a combination of the default and its extension). # 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_hangouts_configuration_yaml`. # You most likely don't need to touch this variable. Instead, see `matrix_mautrix_hangouts_configuration_yaml`.
matrix_mautrix_hangouts_configuration: "{{ matrix_mautrix_hangouts_configuration_yaml|from_yaml|combine(matrix_mautrix_hangouts_configuration_extension, recursive=True) }}" matrix_mautrix_hangouts_configuration: "{{ matrix_mautrix_hangouts_configuration_yaml | from_yaml|combine(matrix_mautrix_hangouts_configuration_extension, recursive=True) }}"
matrix_mautrix_hangouts_registration_yaml: | matrix_mautrix_hangouts_registration_yaml: |
id: hangouts id: hangouts
@ -118,4 +118,4 @@ matrix_mautrix_hangouts_registration_yaml: |
rate_limited: false rate_limited: false
de.sorunome.msc2409.push_ephemeral: true de.sorunome.msc2409.push_ephemeral: true
matrix_mautrix_hangouts_registration: "{{ matrix_mautrix_hangouts_registration_yaml|from_yaml }}" matrix_mautrix_hangouts_registration: "{{ matrix_mautrix_hangouts_registration_yaml | from_yaml }}"

View file

@ -8,24 +8,24 @@
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-mautrix-hangouts.service'] }}" matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-mautrix-hangouts.service'] }}"
when: matrix_mautrix_hangouts_enabled|bool when: matrix_mautrix_hangouts_enabled | bool
# If the matrix-synapse role is not used, these variables may not exist. # If the matrix-synapse role is not used, these variables may not exist.
- ansible.builtin.set_fact: - ansible.builtin.set_fact:
matrix_synapse_container_extra_arguments: > matrix_synapse_container_extra_arguments: >
{{ {{
matrix_synapse_container_extra_arguments|default([]) matrix_synapse_container_extra_arguments | default([])
+ +
["--mount type=bind,src={{ matrix_mautrix_hangouts_config_path }}/registration.yaml,dst=/matrix-mautrix-hangouts-registration.yaml,ro"] ["--mount type=bind,src={{ matrix_mautrix_hangouts_config_path }}/registration.yaml,dst=/matrix-mautrix-hangouts-registration.yaml,ro"]
}} }}
matrix_synapse_app_service_config_files: > matrix_synapse_app_service_config_files: >
{{ {{
matrix_synapse_app_service_config_files|default([]) matrix_synapse_app_service_config_files | default([])
+ +
["/matrix-mautrix-hangouts-registration.yaml"] ["/matrix-mautrix-hangouts-registration.yaml"]
}} }}
when: matrix_mautrix_hangouts_enabled|bool when: matrix_mautrix_hangouts_enabled | bool
- block: - block:
- name: Fail if matrix-nginx-proxy role already executed - 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. 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, 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-hangouts role. so that the matrix-nginx-proxy role would run after the matrix-bridge-mautrix-hangouts role.
when: matrix_nginx_proxy_role_executed|default(False)|bool when: matrix_nginx_proxy_role_executed | default(False) | bool
- name: Generate Mautrix Hangouts proxying configuration for matrix-nginx-proxy - name: Generate Mautrix Hangouts proxying configuration for matrix-nginx-proxy
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_mautrix_hangouts_matrix_nginx_proxy_configuration: | matrix_mautrix_hangouts_matrix_nginx_proxy_configuration: |
location {{ matrix_mautrix_hangouts_public_endpoint }} { location {{ matrix_mautrix_hangouts_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 #} {# Use the embedded DNS resolver in Docker containers to discover the service #}
resolver 127.0.0.11 valid=5s; resolver 127.0.0.11 valid=5s;
set $backend "matrix-mautrix-hangouts:8080"; set $backend "matrix-mautrix-hangouts:8080";
@ -55,13 +55,13 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: | 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_hangouts_matrix_nginx_proxy_configuration] [matrix_mautrix_hangouts_matrix_nginx_proxy_configuration]
}} }}
tags: tags:
- always - always
when: matrix_mautrix_hangouts_enabled|bool when: matrix_mautrix_hangouts_enabled | bool
- name: Warn about reverse-proxying if matrix-nginx-proxy not used - name: Warn about reverse-proxying if matrix-nginx-proxy not used
ansible.builtin.debug: ansible.builtin.debug:
@ -71,4 +71,4 @@
Please make sure that you're proxying the `{{ matrix_mautrix_hangouts_public_endpoint }}` Please make sure that you're proxying the `{{ matrix_mautrix_hangouts_public_endpoint }}`
URL endpoint to the matrix-mautrix-hangouts container. URL endpoint to the matrix-mautrix-hangouts container.
You can expose the container's port using the `matrix_mautrix_hangouts_container_http_host_bind_port` variable. You can expose the container's port using the `matrix_mautrix_hangouts_container_http_host_bind_port` variable.
when: "matrix_mautrix_hangouts_enabled|bool and not matrix_nginx_proxy_enabled|default(False)|bool" when: "matrix_mautrix_hangouts_enabled | bool and not matrix_nginx_proxy_enabled | default(False) | bool"

Some files were not shown because too many files have changed in this diff Show more