Merge branch 'master' into synapse-s3-sse-c
This commit is contained in:
@ -1,7 +1,9 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup.yml"
|
||||
when: run_stop | bool
|
||||
- block:
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-aux-files
|
||||
- install-all
|
||||
- install-aux-files
|
||||
|
@ -37,9 +37,9 @@ matrix_backup_borg_location_source_directories: []
|
||||
|
||||
# postgres db backup
|
||||
matrix_backup_borg_postgresql_enabled: true
|
||||
matrix_backup_borg_supported_postgres_versions: ['12', '13', '14']
|
||||
matrix_backup_borg_supported_postgres_versions: ['12', '13', '14', '15']
|
||||
matrix_backup_borg_postgresql_databases: []
|
||||
matrix_backup_borg_postgresql_databases_hostname: "matrix-postgres"
|
||||
matrix_backup_borg_postgresql_databases_hostname: ''
|
||||
matrix_backup_borg_postgresql_databases_username: "matrix"
|
||||
matrix_backup_borg_postgresql_databases_password: ""
|
||||
matrix_backup_borg_postgresql_databases_port: 5432
|
||||
|
@ -1,4 +0,0 @@
|
||||
---
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-backup-borg.timer'] }}"
|
||||
when: matrix_backup_borg_enabled | bool
|
@ -1,23 +1,20 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
- block:
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup | bool and matrix_backup_borg_enabled | bool"
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup | bool and matrix_backup_borg_enabled | bool"
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_backup_borg_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-backup-borg
|
||||
- install-all
|
||||
- install-backup-borg
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_backup_borg_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-backup-borg
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_backup_borg_enabled | bool"
|
||||
- block:
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_backup_borg_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-backup-borg
|
||||
|
@ -5,22 +5,22 @@
|
||||
- name: Fail with matrix_backup_borg_version advice if Postgres not enabled
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You are not running a built-in Postgres server (`matrix_postgres_enabled: false`), so auto-detecting its version and setting `matrix_backup_borg_version` automatically based on that cannot happen.
|
||||
You are not running a built-in Postgres server (`devture_postgres_enabled: false`), so auto-detecting its version and setting `matrix_backup_borg_version` automatically based on that cannot happen.
|
||||
Consider setting `matrix_backup_borg_version` to your Postgres version manually.
|
||||
when: not matrix_postgres_enabled
|
||||
when: not devture_postgres_enabled
|
||||
|
||||
- ansible.builtin.import_role:
|
||||
name: custom/matrix-postgres
|
||||
- ansible.builtin.include_role:
|
||||
name: galaxy/com.devture.ansible.role.postgres
|
||||
tasks_from: detect_existing_postgres_version
|
||||
|
||||
- name: Fail if detected Postgres version is unsupported
|
||||
ansible.builtin.fail:
|
||||
msg: "You cannot use borg backup with such an old version ({{ matrix_postgres_detected_version }}) of Postgres. Consider upgrading - link to docs for upgrading Postgres: docs/maintenance-postgres.md#upgrading-postgresql"
|
||||
when: "matrix_postgres_detected_version not in matrix_backup_borg_supported_postgres_versions"
|
||||
msg: "You cannot use borg backup with such an old version ({{ devture_postgres_detected_version }}) of Postgres. Consider upgrading - link to docs for upgrading Postgres: docs/maintenance-postgres.md#upgrading-postgresql"
|
||||
when: "devture_postgres_detected_version not in matrix_backup_borg_supported_postgres_versions"
|
||||
|
||||
- name: Set the correct borg backup version to use
|
||||
ansible.builtin.set_fact:
|
||||
matrix_backup_borg_version: "{{ matrix_postgres_detected_version }}"
|
||||
matrix_backup_borg_version: "{{ devture_postgres_detected_version }}"
|
||||
|
||||
- name: Ensure borg paths exist
|
||||
ansible.builtin.file:
|
||||
@ -105,19 +105,3 @@
|
||||
src: "{{ role_path }}/templates/systemd/matrix-backup-borg.timer.j2"
|
||||
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-backup-borg.timer"
|
||||
mode: 0644
|
||||
register: matrix_backup_borg_systemd_timer_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-backup-borg.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_backup_borg_systemd_service_result.changed | bool"
|
||||
|
||||
- name: Ensure matrix-backup-borg.service enabled
|
||||
ansible.builtin.service:
|
||||
enabled: true
|
||||
name: matrix-backup-borg.service
|
||||
|
||||
- name: Ensure matrix-backup-borg.timer enabled
|
||||
ansible.builtin.service:
|
||||
enabled: true
|
||||
name: matrix-backup-borg.timer
|
||||
|
@ -1,41 +1,25 @@
|
||||
---
|
||||
|
||||
- name: Check existence of matrix-backup-borg service
|
||||
ansible.builtin.stat:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-backup-borg.service"
|
||||
register: matrix_backup_borg_service_stat
|
||||
|
||||
- name: Ensure matrix-backup-borg is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-backup-borg
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
register: stopping_result
|
||||
when: "matrix_backup_borg_service_stat.stat.exists | bool"
|
||||
- when: matrix_backup_borg_service_stat.stat.exists | bool
|
||||
block:
|
||||
- name: Ensure matrix-backup-borg is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-backup-borg
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Ensure matrix-backup-borg.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-backup-borg.service"
|
||||
state: absent
|
||||
when: "matrix_backup_borg_service_stat.stat.exists | bool"
|
||||
- name: Ensure matrix-backup-borg.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-backup-borg.service"
|
||||
state: absent
|
||||
|
||||
- name: Ensure matrix-backup-borg.timer doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-backup-borg.timer"
|
||||
state: absent
|
||||
when: "matrix_backup_borg_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-backup-borg.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_backup_borg_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure Matrix borg paths don't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_backup_borg_base_path }}"
|
||||
state: absent
|
||||
|
||||
- name: Ensure borg Docker image doesn't exist
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_backup_borg_docker_image }}"
|
||||
state: absent
|
||||
- name: Ensure matrix-backup-borg.timer doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-backup-borg.timer"
|
||||
state: absent
|
||||
|
@ -1,12 +1,13 @@
|
||||
---
|
||||
- name: Fail if required settings not defined
|
||||
- name: Fail if required backup-borg settings not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item }}`).
|
||||
when: "vars[item] == ''"
|
||||
You need to define a required configuration setting (`{{ item.name }}`).
|
||||
when: "item.when | bool and vars[item.name] == ''"
|
||||
with_items:
|
||||
- "matrix_backup_borg_ssh_key_private"
|
||||
- "matrix_backup_borg_location_repositories"
|
||||
- {'name': 'matrix_backup_borg_ssh_key_private', when: true}
|
||||
- {'name': 'matrix_backup_borg_location_repositories', when: true}
|
||||
- {'name': 'matrix_backup_borg_postgresql_databases_hostname', when: "{{ matrix_backup_borg_postgresql_enabled }}"}
|
||||
|
||||
- name: Fail if encryption passphrase is undefined unless repository is unencrypted
|
||||
ansible.builtin.fail:
|
||||
|
@ -34,7 +34,7 @@ hooks:
|
||||
hostname: {{ matrix_backup_borg_postgresql_databases_hostname|to_json }}
|
||||
username: {{ matrix_backup_borg_postgresql_databases_username|to_json }}
|
||||
password: {{ matrix_backup_borg_postgresql_databases_password|to_json }}
|
||||
port: {{ matrix_backup_borg_postgresql_databases_port|to_json }}
|
||||
port: {{ matrix_backup_borg_postgresql_databases_port | int | to_json }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
after_backup:
|
||||
|
@ -31,14 +31,21 @@ ExecStartPre=-{{ devture_systemd_docker_base_host_command_docker }} run --rm --n
|
||||
{{ arg }} \
|
||||
{% endfor %}
|
||||
{{ matrix_backup_borg_docker_image }} \
|
||||
sh -c "borgmatic --init --encryption {{ matrix_backup_borg_encryption }}"
|
||||
sh -c "borgmatic rcreate --encryption {{ matrix_backup_borg_encryption }}"
|
||||
|
||||
# The `CAP_DAC_OVERRIDE` capability is required, so that `root` in the container
|
||||
# can read the `/etc/borgmatic.d/config.yaml` (`{{ matrix_backup_borg_config_path }}/config.yaml`) file,
|
||||
# owned by `matrix:matrix` on the filesystem.
|
||||
#
|
||||
# `/root` is mountes as temporary filesystem, because we're using `--read-only` and because
|
||||
# Borgmatic tries to write to at least a few paths under `/root` (`.config`, `.ssh`, `.borgmatic`).
|
||||
ExecStart={{ devture_systemd_docker_base_host_command_docker }} run --rm --name matrix-backup-borg \
|
||||
--log-driver=none \
|
||||
--cap-drop=ALL \
|
||||
--cap-add=CAP_DAC_OVERRIDE \
|
||||
--read-only \
|
||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
||||
--network={{ matrix_docker_network }} \
|
||||
--tmpfs=/root:rw,noexec,nosuid,size=100m \
|
||||
--tmpfs=/tmp:rw,noexec,nosuid,size=100m \
|
||||
--mount type=bind,src={{ matrix_backup_borg_config_path }}/passwd,dst=/etc/passwd,ro \
|
||||
--mount type=bind,src={{ matrix_backup_borg_config_path }},dst=/etc/borgmatic.d,ro \
|
||||
|
@ -1,4 +1,5 @@
|
||||
---
|
||||
|
||||
# The bare domain name which represents your Matrix identity.
|
||||
# Matrix user ids for your server will be of the form (`@user:<matrix-domain>`).
|
||||
#
|
||||
@ -12,6 +13,15 @@ matrix_domain: ~
|
||||
# Example value: "@someone:{{ matrix_domain }}"
|
||||
matrix_admin: ''
|
||||
|
||||
# matrix_homeserver_enabled controls whether to enable the homeserver systemd service, etc.
|
||||
#
|
||||
# Unless you're wrapping this playbook in another one
|
||||
# where you optionally wish to disable homeserver integration, you don't need to use this.
|
||||
#
|
||||
# Note: disabling this does not mean that a homeserver won't get installed.
|
||||
# Whether homeserver software is installed depends on other (`matrix_HOMESERVER_enabled`) variables - see `group_vars/matrix_servers`.
|
||||
matrix_homeserver_enabled: true
|
||||
|
||||
# Homeserver admin contacts and support page as per MSC 1929
|
||||
# See: https://github.com/matrix-org/matrix-spec-proposals/pull/1929
|
||||
# Users in form:
|
||||
@ -86,7 +96,7 @@ matrix_federation_public_port: 8448
|
||||
# Recognized values by us are 'amd64', 'arm32' and 'arm64'.
|
||||
# Not all architectures support all services, so your experience (on non-amd64) may vary.
|
||||
# See docs/alternative-architectures.md
|
||||
matrix_architecture: amd64
|
||||
matrix_architecture: "{{ 'amd64' if ansible_architecture == 'x86_64' else ('arm64' if ansible_architecture == 'aarch64' else ('arm32' if ansible_architecture.startswith('armv') else '')) }}"
|
||||
|
||||
# The architecture for Debian packages.
|
||||
# See: https://wiki.debian.org/SupportedArchitectures
|
||||
@ -107,14 +117,10 @@ matrix_user_gid: ~
|
||||
matrix_base_data_path: "/matrix"
|
||||
matrix_base_data_path_mode: "750"
|
||||
|
||||
matrix_bin_path: "{{ matrix_base_data_path }}/bin"
|
||||
|
||||
matrix_static_files_base_path: "{{ matrix_base_data_path }}/static-files"
|
||||
|
||||
# This is now unused. We keep it so that cleanup tasks can use it.
|
||||
# To be removed in the future.
|
||||
matrix_cron_path: "/etc/cron.d"
|
||||
|
||||
matrix_local_bin_path: "/usr/local/bin"
|
||||
|
||||
matrix_host_command_sleep: "/usr/bin/env sleep"
|
||||
matrix_host_command_chown: "/usr/bin/env chown"
|
||||
matrix_host_command_fusermount: "/usr/bin/env fusermount"
|
||||
@ -253,13 +259,8 @@ matrix_well_known_matrix_server_enabled: true
|
||||
# See `matrix_homeserver_admin_contacts`, `matrix_homeserver_support_url`, etc.
|
||||
matrix_well_known_matrix_support_enabled: false
|
||||
|
||||
# Controls whether Docker is automatically installed.
|
||||
# If you change this to false you must install and update Docker manually. You also need to install the docker (https://pypi.org/project/docker/) Python package.
|
||||
matrix_docker_installation_enabled: true
|
||||
|
||||
# Controls the Docker package that is installed.
|
||||
# Possible values are "docker-ce" (default) and "docker.io" (Debian).
|
||||
matrix_docker_package_name: docker-ce
|
||||
matrix_homeserver_container_extra_arguments_auto: []
|
||||
matrix_homeserver_app_service_config_files_auto: []
|
||||
|
||||
# Variables to Control which parts of our roles run.
|
||||
run_postgres_import: true
|
||||
|
@ -1,9 +0,0 @@
|
||||
---
|
||||
|
||||
- name: Get rid of old files and directories
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: absent
|
||||
with_items:
|
||||
- "{{ matrix_base_data_path }}/environment-variables"
|
||||
- "{{ matrix_base_data_path }}/scratchpad"
|
@ -1,37 +1,39 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/sanity_check.yml"
|
||||
tags:
|
||||
- always
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/clean_up_old_files.yml"
|
||||
when: run_setup | bool
|
||||
tags:
|
||||
- setup-all
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/server_base/setup.yml"
|
||||
when: run_setup | bool
|
||||
- block:
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- install-all
|
||||
|
||||
# This needs to always run, because it populates `matrix_user_uid` and `matrix_user_gid`,
|
||||
# which are required by many other roles.
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_matrix_user.yml"
|
||||
when: run_setup | bool
|
||||
- block:
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_matrix_user.yml"
|
||||
tags:
|
||||
- always
|
||||
- setup-system-user
|
||||
- common
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_matrix_base.yml"
|
||||
when: run_setup | bool
|
||||
- block:
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_matrix_base.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- install-all
|
||||
- common
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_well_known.yml"
|
||||
when: run_setup | bool
|
||||
- block:
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_well_known.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-ma1sd
|
||||
- setup-synapse
|
||||
- setup-dendrite
|
||||
- setup-conduit
|
||||
- setup-nginx-proxy
|
||||
- install-all
|
||||
- install-ma1sd
|
||||
- install-synapse
|
||||
- install-dendrite
|
||||
- install-conduit
|
||||
- install-nginx-proxy
|
||||
|
@ -1,41 +0,0 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/server_base/setup_redhat.yml"
|
||||
when: ansible_os_family == 'RedHat' and ansible_distribution_major_version | int < 8
|
||||
|
||||
- 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
|
||||
|
||||
- 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 == 'Debian'
|
||||
block:
|
||||
# ansible_lsb is only available if lsb-release is installed.
|
||||
- name: Ensure lsb-release installed
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- lsb-release
|
||||
state: present
|
||||
update_cache: true
|
||||
register: lsb_release_installation_result
|
||||
|
||||
- name: Reread ansible_lsb facts if lsb-release got installed
|
||||
ansible.builtin.setup:
|
||||
filter: ansible_lsb*
|
||||
when: lsb_release_installation_result.changed
|
||||
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/server_base/setup_debian.yml"
|
||||
when: (ansible_os_family == 'Debian') and (ansible_lsb.id != 'Raspbian')
|
||||
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/server_base/setup_raspbian.yml"
|
||||
when: (ansible_os_family == 'Debian') and (ansible_lsb.id == 'Raspbian')
|
||||
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/server_base/setup_archlinux.yml"
|
||||
when: ansible_distribution == 'Archlinux'
|
||||
|
||||
- name: Ensure Docker is started and autoruns
|
||||
ansible.builtin.service:
|
||||
name: docker
|
||||
state: started
|
||||
enabled: true
|
@ -1,16 +0,0 @@
|
||||
---
|
||||
|
||||
- name: Install host dependencies
|
||||
community.general.pacman:
|
||||
name:
|
||||
- python-docker
|
||||
- python-dnspython
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
- name: Ensure Docker is installed
|
||||
community.general.pacman:
|
||||
name:
|
||||
- docker
|
||||
state: present
|
||||
when: matrix_docker_installation_enabled | bool
|
@ -1,34 +0,0 @@
|
||||
---
|
||||
|
||||
- name: Ensure APT usage dependencies are installed
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- apt-transport-https
|
||||
- ca-certificates
|
||||
- gnupg
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
- name: Ensure Docker's APT key is trusted
|
||||
ansible.builtin.apt_key:
|
||||
url: "https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg"
|
||||
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
|
||||
state: present
|
||||
register: add_repository_key
|
||||
ignore_errors: true
|
||||
when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
|
||||
|
||||
- name: Ensure Docker repository is enabled
|
||||
ansible.builtin.apt_repository:
|
||||
repo: "deb [arch={{ matrix_debian_arch }}] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable"
|
||||
state: present
|
||||
update_cache: true
|
||||
when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
|
||||
|
||||
- name: Ensure Docker is installed
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- "{{ matrix_docker_package_name }}"
|
||||
- "python{{ '3' if ansible_python.version.major == 3 else '' }}-docker"
|
||||
state: present
|
||||
when: matrix_docker_installation_enabled | bool
|
@ -1,32 +0,0 @@
|
||||
---
|
||||
|
||||
- name: Ensure Docker repository is enabled
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/files/yum.repos.d/{{ item }}"
|
||||
dest: "/etc/yum.repos.d/docker-ce.repo"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: 0644
|
||||
with_items:
|
||||
- docker-ce-fedora.repo
|
||||
when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
|
||||
|
||||
- name: Ensure Docker's RPM key is trusted
|
||||
ansible.builtin.rpm_key:
|
||||
state: present
|
||||
key: https://download.docker.com/linux/fedora/gpg
|
||||
when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
|
||||
|
||||
- name: Ensure Docker is installed
|
||||
ansible.builtin.yum:
|
||||
name:
|
||||
- "{{ matrix_docker_package_name }}"
|
||||
- python3-pip
|
||||
state: present
|
||||
when: matrix_docker_installation_enabled | bool
|
||||
|
||||
- name: Ensure Docker-Py is installed
|
||||
ansible.builtin.pip:
|
||||
name: docker-py
|
||||
state: present
|
||||
when: matrix_docker_installation_enabled | bool
|
@ -1,34 +0,0 @@
|
||||
---
|
||||
|
||||
- name: Ensure APT usage dependencies are installed
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- apt-transport-https
|
||||
- ca-certificates
|
||||
- gnupg
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
- name: Ensure Docker's APT key is trusted
|
||||
ansible.builtin.apt_key:
|
||||
url: https://download.docker.com/linux/raspbian/gpg
|
||||
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
|
||||
state: present
|
||||
register: add_repository_key
|
||||
ignore_errors: true
|
||||
when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
|
||||
|
||||
- name: Ensure Docker repository is enabled
|
||||
ansible.builtin.apt_repository:
|
||||
repo: "deb [arch={{ matrix_debian_arch }}] https://download.docker.com/linux/raspbian {{ ansible_distribution_release }} stable"
|
||||
state: present
|
||||
update_cache: true
|
||||
when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
|
||||
|
||||
- name: Ensure Docker is installed
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- "{{ matrix_docker_package_name }}"
|
||||
- "python{{ '3' if ansible_python.version.major == 3 else '' }}-docker"
|
||||
state: present
|
||||
when: matrix_docker_installation_enabled | bool
|
@ -1,24 +0,0 @@
|
||||
---
|
||||
|
||||
- name: Ensure Docker repository is enabled
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/files/yum.repos.d/docker-ce-centos.repo"
|
||||
dest: "/etc/yum.repos.d/docker-ce.repo"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: 0644
|
||||
when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
|
||||
|
||||
- name: Ensure Docker's RPM key is trusted
|
||||
ansible.builtin.rpm_key:
|
||||
state: present
|
||||
key: https://download.docker.com/linux/centos/gpg
|
||||
when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
|
||||
|
||||
- name: Ensure Docker is installed
|
||||
ansible.builtin.yum:
|
||||
name:
|
||||
- "{{ matrix_docker_package_name }}"
|
||||
- docker-python
|
||||
state: present
|
||||
when: matrix_docker_installation_enabled | bool
|
@ -1,37 +0,0 @@
|
||||
---
|
||||
|
||||
- name: Ensure Docker repository is enabled
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/files/yum.repos.d/docker-ce-centos.repo"
|
||||
dest: "/etc/yum.repos.d/docker-ce.repo"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: 0644
|
||||
when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
|
||||
|
||||
- name: Ensure Docker's RPM key is trusted
|
||||
ansible.builtin.rpm_key:
|
||||
state: present
|
||||
key: https://download.docker.com/linux/centos/gpg
|
||||
when: matrix_docker_installation_enabled | bool and matrix_docker_package_name == 'docker-ce'
|
||||
|
||||
- name: Ensure EPEL is installed
|
||||
ansible.builtin.yum:
|
||||
name:
|
||||
- epel-release
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
- name: Ensure Docker is installed
|
||||
ansible.builtin.yum:
|
||||
name:
|
||||
- "{{ matrix_docker_package_name }}"
|
||||
- python3-pip
|
||||
state: present
|
||||
when: matrix_docker_installation_enabled | bool
|
||||
|
||||
- name: Ensure Docker-Py is installed
|
||||
ansible.builtin.pip:
|
||||
name: docker-py
|
||||
state: present
|
||||
when: matrix_docker_installation_enabled | bool
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
|
||||
- name: Ensure Matrix base path exists
|
||||
- name: Ensure Matrix base paths exists
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
@ -9,14 +9,15 @@
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
with_items:
|
||||
- "{{ matrix_base_data_path }}"
|
||||
- "{{ matrix_bin_path }}"
|
||||
|
||||
- name: Ensure Matrix network is created in Docker
|
||||
community.docker.docker_network:
|
||||
name: "{{ matrix_docker_network }}"
|
||||
driver: bridge
|
||||
|
||||
- name: Ensure matrix-remove-all script created
|
||||
- name: Ensure remove-all script created
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/usr-local-bin/matrix-remove-all.j2"
|
||||
dest: "{{ matrix_local_bin_path }}/matrix-remove-all"
|
||||
src: "{{ role_path }}/templates/bin/remove-all.j2"
|
||||
dest: "{{ matrix_bin_path }}/remove-all"
|
||||
mode: 0750
|
||||
|
@ -7,10 +7,6 @@
|
||||
state: present
|
||||
register: matrix_group
|
||||
|
||||
- name: Set Matrix Group GID Variable
|
||||
ansible.builtin.set_fact:
|
||||
matrix_user_gid: "{{ matrix_group.gid }}"
|
||||
|
||||
- name: Ensure Matrix user is created
|
||||
ansible.builtin.user:
|
||||
name: "{{ matrix_user_username }}"
|
||||
@ -22,6 +18,7 @@
|
||||
system: true
|
||||
register: matrix_user
|
||||
|
||||
- name: Set Matrix Group UID Variable
|
||||
- name: Initialize matrix_user_uid and matrix_user_gid
|
||||
ansible.builtin.set_fact:
|
||||
matrix_user_uid: "{{ matrix_user.uid }}"
|
||||
matrix_user_gid: "{{ matrix_group.gid }}"
|
||||
|
@ -5,21 +5,6 @@
|
||||
msg: "You need to set a valid homeserver implementation in `matrix_homeserver_implementation`"
|
||||
when: "matrix_homeserver_implementation not in ['synapse', 'dendrite', 'conduit']"
|
||||
|
||||
# We generally support Ansible 2.7.1 and above.
|
||||
- name: Fail if running on Ansible < 2.7.1
|
||||
ansible.builtin.fail:
|
||||
msg: "You are running on Ansible {{ ansible_version.string }}, which is not supported. See our guide about Ansible: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/ansible.md"
|
||||
when:
|
||||
- "(ansible_version.major < 2) or (ansible_version.major == 2 and ansible_version.minor < 7) or (ansible_version.major == 2 and ansible_version.minor == 7 and ansible_version.revision < 1)"
|
||||
|
||||
# Though we do not support Ansible 2.9.6 which is buggy
|
||||
- name: Fail if running on Ansible 2.9.6 on Ubuntu
|
||||
ansible.builtin.fail:
|
||||
msg: "You are running on Ansible {{ ansible_version.string }}, which is not supported. See our guide about Ansible: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/ansible.md"
|
||||
when:
|
||||
- ansible_distribution == 'Ubuntu'
|
||||
- "ansible_version.major == 2 and ansible_version.minor == 9 and ansible_version.revision == 6"
|
||||
|
||||
- name: (Deprecation) Catch and report renamed settings
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
@ -32,6 +17,7 @@
|
||||
- {'old': 'hostname_matrix', 'new': 'matrix_server_fqn_matrix'}
|
||||
- {'old': 'hostname_riot', 'new': 'matrix_server_fqn_element'}
|
||||
- {'old': 'matrix_server_fqn_riot', 'new': 'matrix_server_fqn_element'}
|
||||
- {'old': 'matrix_local_bin_path', 'new': '<there is no global bin path anymore - each role has its own>'}
|
||||
|
||||
# We have a dedicated check for this variable, because we'd like to have a custom (friendlier) message.
|
||||
- name: Fail if matrix_homeserver_generic_secret_key is undefined
|
||||
@ -40,6 +26,8 @@
|
||||
The `matrix_homeserver_generic_secret_key` variable must be defined and have a non-null and non-empty value.
|
||||
|
||||
If you're observing this error on a new installation, you should ensure that the `matrix_homeserver_generic_secret_key` is defined.
|
||||
If you think you've defined it, but are still getting this error, then it's likely that you have a typo
|
||||
in your domain name in `inventory/hosts` or in one of the directories leading up to your `inventory/host_vars/matrix.DOMAIN/vars.yml` file.
|
||||
|
||||
If you're observing this error on an existing homeserver installation, you can fix it easily and in a backward-compatible way by adding
|
||||
`{% raw %}matrix_homeserver_generic_secret_key: "{{ matrix_synapse_macaroon_secret_key }}"{% endraw %}`
|
||||
@ -55,8 +43,14 @@
|
||||
- {'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_federation_url, 'value': "{{ matrix_homeserver_container_federation_url | default('') }}"}
|
||||
- {'var': matrix_architecture, 'value': "{{ matrix_architecture | default('') }}"}
|
||||
when: "item.value is none or item.value == ''"
|
||||
|
||||
- name: Fail if matrix_architecture is set incorrectly
|
||||
ansible.builtin.fail:
|
||||
msg: "Detected that variable matrix_architecture {{ matrix_architecture }} appears to be set incorrectly. See docs/alternative-architectures.md. Server appears to be {{ ansible_architecture }}."
|
||||
when: matrix_architecture not in ['amd64', 'arm32', 'arm64']
|
||||
|
||||
- name: Fail if uppercase domain used
|
||||
ansible.builtin.fail:
|
||||
msg: "Detected that you're using an uppercase domain name - `{{ item }}`. This will cause trouble. Please use all-lowercase!"
|
||||
@ -66,20 +60,6 @@
|
||||
- "{{ matrix_server_fqn_element }}"
|
||||
when: "item != item | lower"
|
||||
|
||||
- name: Fail if using python2 on Archlinux
|
||||
ansible.builtin.fail:
|
||||
msg: "Detected that you're using python2 when installing onto Archlinux. Archlinux by default only supports python3."
|
||||
when:
|
||||
- ansible_distribution == 'Archlinux'
|
||||
- ansible_python.version.major != 3
|
||||
|
||||
- name: Fail if architecture is set incorrectly
|
||||
ansible.builtin.fail:
|
||||
msg: "Detected that variable matrix_architecture {{ matrix_architecture }} appears to be set incorrectly. See docs/alternative-architectures.md. Server appears to be {{ ansible_architecture }}."
|
||||
when: (ansible_architecture == "x86_64" and matrix_architecture != "amd64") or
|
||||
(ansible_architecture == "aarch64" and matrix_architecture != "arm64") or
|
||||
(ansible_architecture.startswith("armv") and matrix_architecture != "arm32")
|
||||
|
||||
- name: Fail if encountering usage of removed role (mx-puppet-skype)
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
@ -23,8 +23,6 @@ else
|
||||
|
||||
systemctl daemon-reload
|
||||
|
||||
echo "Remove matrix scripts"
|
||||
find {{ matrix_local_bin_path }}/ -name "matrix-*" -delete
|
||||
echo "Remove unused Docker images and resources"
|
||||
docker system prune -af
|
||||
echo "Remove Docker matrix network (should be gone already, but ..)"
|
@ -25,6 +25,11 @@
|
||||
"im.vector.riot.jitsi": {
|
||||
"preferredDomain": {{ matrix_client_element_jitsi_preferredDomain|to_json }}
|
||||
}
|
||||
{% endif %}
|
||||
{% if matrix_client_element_location_sharing_enabled %},
|
||||
"m.tile_server": {
|
||||
"map_style_url": "https://{{ matrix_server_fqn_element }}/map_style.json"
|
||||
}
|
||||
{% endif %}
|
||||
,
|
||||
"io.element.e2ee": {
|
||||
|
@ -1,7 +0,0 @@
|
||||
---
|
||||
# This will contain a list of enabled services that the playbook is managing.
|
||||
# Each component is expected to append its service name to this list.
|
||||
matrix_systemd_services_list: []
|
||||
|
||||
matrix_homeserver_container_runtime_injected_arguments: []
|
||||
matrix_homeserver_app_service_runtime_injected_config_files: []
|
@ -43,7 +43,7 @@ matrix_bot_buscarron_sqlite_database_path_in_container: "/data/bot.db"
|
||||
|
||||
matrix_bot_buscarron_database_username: 'buscarron'
|
||||
matrix_bot_buscarron_database_password: 'some-password'
|
||||
matrix_bot_buscarron_database_hostname: 'matrix-postgres'
|
||||
matrix_bot_buscarron_database_hostname: ''
|
||||
matrix_bot_buscarron_database_port: 5432
|
||||
matrix_bot_buscarron_database_name: 'buscarron'
|
||||
|
||||
|
@ -1,5 +0,0 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-buscarron.service'] }}"
|
||||
when: matrix_bot_buscarron_enabled | bool
|
@ -1,23 +1,20 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
- block:
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup | bool and matrix_bot_buscarron_enabled | bool"
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup | bool and matrix_bot_buscarron_enabled | bool"
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_bot_buscarron_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-buscarron
|
||||
- install-all
|
||||
- install-bot-buscarron
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_bot_buscarron_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-buscarron
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_bot_buscarron_enabled | bool"
|
||||
- block:
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_bot_buscarron_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-buscarron
|
||||
|
@ -11,8 +11,11 @@
|
||||
|
||||
- when: "matrix_bot_buscarron_sqlite_database_path_local_stat_result.stat.exists | bool"
|
||||
block:
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_postgres_db_migration_request:
|
||||
- ansible.builtin.include_role:
|
||||
name: galaxy/com.devture.ansible.role.postgres
|
||||
tasks_from: migrate_db_to_postgres
|
||||
vars:
|
||||
devture_postgres_db_migration_request:
|
||||
src: "{{ matrix_bot_buscarron_sqlite_database_path_local }}"
|
||||
dst: "{{ matrix_bot_buscarron_database_connection_string }}"
|
||||
caller: "{{ role_path | basename }}"
|
||||
@ -20,10 +23,6 @@
|
||||
engine_old: 'sqlite'
|
||||
systemd_services_to_stop: ['matrix-bot-buscarron.service']
|
||||
|
||||
- ansible.builtin.import_role:
|
||||
name: custom/matrix-postgres
|
||||
tasks_from: migrate_db_to_postgres
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_bot_buscarron_requires_restart: true
|
||||
|
||||
@ -89,15 +88,10 @@
|
||||
src: "{{ role_path }}/templates/systemd/matrix-bot-buscarron.service.j2"
|
||||
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-buscarron.service"
|
||||
mode: 0644
|
||||
register: matrix_bot_buscarron_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-bot-buscarron.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_buscarron_systemd_service_result.changed | bool"
|
||||
|
||||
- name: Ensure matrix-bot-buscarron.service restarted, if necessary
|
||||
ansible.builtin.service:
|
||||
name: "matrix-bot-buscarron.service"
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_buscarron_requires_restart | bool"
|
||||
|
@ -5,32 +5,21 @@
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-buscarron.service"
|
||||
register: matrix_bot_buscarron_service_stat
|
||||
|
||||
- name: Ensure matrix-buscarron is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-bot-buscarron
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
register: stopping_result
|
||||
when: "matrix_bot_buscarron_service_stat.stat.exists | bool"
|
||||
- when: matrix_bot_buscarron_service_stat.stat.exists | bool
|
||||
block:
|
||||
- name: Ensure matrix-buscarron is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-bot-buscarron
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Ensure matrix-bot-buscarron.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-buscarron.service"
|
||||
state: absent
|
||||
when: "matrix_bot_buscarron_service_stat.stat.exists | bool"
|
||||
- name: Ensure matrix-bot-buscarron.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-buscarron.service"
|
||||
state: absent
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-bot-buscarron.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_buscarron_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure Matrix buscarron paths don't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_bot_buscarron_base_path }}"
|
||||
state: absent
|
||||
|
||||
- name: Ensure buscarron Docker image doesn't exist
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_bot_buscarron_docker_image }}"
|
||||
state: absent
|
||||
- name: Ensure Matrix buscarron paths don't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_bot_buscarron_base_path }}"
|
||||
state: absent
|
||||
|
@ -1,9 +1,10 @@
|
||||
---
|
||||
|
||||
- name: Fail if required settings not defined
|
||||
- name: Fail if required Buscarron settings not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item }}`).
|
||||
when: "vars[item] == ''"
|
||||
You need to define a required configuration setting (`{{ item.name }}`).
|
||||
when: "item.when | bool and vars[item.name] == ''"
|
||||
with_items:
|
||||
- "matrix_bot_buscarron_password"
|
||||
- {'name': 'matrix_bot_buscarron_password', when: true}
|
||||
- {'name': 'matrix_bot_buscarron_database_hostname', when: "{{ matrix_bot_buscarron_database_engine == 'postgres' }}"}
|
||||
|
@ -1,5 +0,0 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-go-neb.service'] }}"
|
||||
when: matrix_bot_go_neb_enabled | bool
|
@ -1,23 +1,20 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
- block:
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup | bool and matrix_bot_go_neb_enabled | bool"
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup | bool and matrix_bot_go_neb_enabled | bool"
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_bot_go_neb_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-go-neb
|
||||
- install-all
|
||||
- install-bot-go-neb
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_bot_go_neb_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-go-neb
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_bot_go_neb_enabled | bool"
|
||||
- block:
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_bot_go_neb_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-go-neb
|
||||
|
@ -42,13 +42,9 @@
|
||||
mode: 0644
|
||||
register: matrix_bot_go_neb_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-bot-go-neb.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_go_neb_systemd_service_result.changed | bool"
|
||||
|
||||
- name: Ensure matrix-bot-go-neb.service restarted, if necessary
|
||||
ansible.builtin.service:
|
||||
name: "matrix-bot-go-neb.service"
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_go_neb_requires_restart | bool"
|
||||
|
@ -5,32 +5,21 @@
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-go-neb.service"
|
||||
register: matrix_bot_go_neb_service_stat
|
||||
|
||||
- name: Ensure matrix-go-neb is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-bot-go-neb
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
register: stopping_result
|
||||
when: "matrix_bot_go_neb_service_stat.stat.exists | bool"
|
||||
- when: matrix_bot_go_neb_service_stat.stat.exists | bool
|
||||
block:
|
||||
- name: Ensure matrix-go-neb is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-bot-go-neb
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Ensure matrix-bot-go-neb.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-go-neb.service"
|
||||
state: absent
|
||||
when: "matrix_bot_go_neb_service_stat.stat.exists | bool"
|
||||
- name: Ensure matrix-bot-go-neb.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-go-neb.service"
|
||||
state: absent
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-bot-go-neb.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_go_neb_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure Matrix go-neb paths don't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_bot_go_neb_base_path }}"
|
||||
state: absent
|
||||
|
||||
- name: Ensure go-neb Docker image doesn't exist
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_bot_go_neb_docker_image }}"
|
||||
state: absent
|
||||
- name: Ensure Matrix go-neb paths don't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_bot_go_neb_base_path }}"
|
||||
state: absent
|
||||
|
@ -43,7 +43,7 @@ matrix_bot_honoroit_sqlite_database_path_in_container: "/data/bot.db"
|
||||
|
||||
matrix_bot_honoroit_database_username: 'honoroit'
|
||||
matrix_bot_honoroit_database_password: 'some-password'
|
||||
matrix_bot_honoroit_database_hostname: 'matrix-postgres'
|
||||
matrix_bot_honoroit_database_hostname: ''
|
||||
matrix_bot_honoroit_database_port: 5432
|
||||
matrix_bot_honoroit_database_name: 'honoroit'
|
||||
|
||||
|
@ -1,5 +0,0 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-honoroit.service'] }}"
|
||||
when: matrix_bot_honoroit_enabled | bool
|
@ -1,23 +1,20 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
- block:
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup | bool and matrix_bot_honoroit_enabled | bool"
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup | bool and matrix_bot_honoroit_enabled | bool"
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_bot_honoroit_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-honoroit
|
||||
- install-all
|
||||
- install-bot-honoroit
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_bot_honoroit_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-honoroit
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_bot_honoroit_enabled | bool"
|
||||
- block:
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_bot_honoroit_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-honoroit
|
||||
|
@ -11,8 +11,11 @@
|
||||
|
||||
- when: "matrix_bot_honoroit_sqlite_database_path_local_stat_result.stat.exists | bool"
|
||||
block:
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_postgres_db_migration_request:
|
||||
- ansible.builtin.include_role:
|
||||
name: galaxy/com.devture.ansible.role.postgres
|
||||
tasks_from: migrate_db_to_postgres
|
||||
vars:
|
||||
devture_postgres_db_migration_request:
|
||||
src: "{{ matrix_bot_honoroit_sqlite_database_path_local }}"
|
||||
dst: "{{ matrix_bot_honoroit_database_connection_string }}"
|
||||
caller: "{{ role_path | basename }}"
|
||||
@ -20,10 +23,6 @@
|
||||
engine_old: 'sqlite'
|
||||
systemd_services_to_stop: ['matrix-bot-honoroit.service']
|
||||
|
||||
- ansible.builtin.import_role:
|
||||
name: custom/matrix-postgres
|
||||
tasks_from: migrate_db_to_postgres
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_bot_honoroit_requires_restart: true
|
||||
|
||||
@ -91,13 +90,9 @@
|
||||
mode: 0644
|
||||
register: matrix_bot_honoroit_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-bot-honoroit.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_honoroit_systemd_service_result.changed | bool"
|
||||
|
||||
- name: Ensure matrix-bot-honoroit.service restarted, if necessary
|
||||
ansible.builtin.service:
|
||||
name: "matrix-bot-honoroit.service"
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_honoroit_requires_restart | bool"
|
||||
|
@ -5,32 +5,21 @@
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-honoroit.service"
|
||||
register: matrix_bot_honoroit_service_stat
|
||||
|
||||
- name: Ensure matrix-honoroit is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-bot-honoroit
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
register: stopping_result
|
||||
when: "matrix_bot_honoroit_service_stat.stat.exists | bool"
|
||||
- when: matrix_bot_honoroit_service_stat.stat.exists | bool
|
||||
block:
|
||||
- name: Ensure matrix-honoroit is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-bot-honoroit
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Ensure matrix-bot-honoroit.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-honoroit.service"
|
||||
state: absent
|
||||
when: "matrix_bot_honoroit_service_stat.stat.exists | bool"
|
||||
- name: Ensure matrix-bot-honoroit.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-honoroit.service"
|
||||
state: absent
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-bot-honoroit.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_honoroit_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure Matrix honoroit paths don't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_bot_honoroit_base_path }}"
|
||||
state: absent
|
||||
|
||||
- name: Ensure honoroit Docker image doesn't exist
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_bot_honoroit_docker_image }}"
|
||||
state: absent
|
||||
- name: Ensure Matrix honoroit paths don't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_bot_honoroit_base_path }}"
|
||||
state: absent
|
||||
|
@ -1,10 +1,11 @@
|
||||
---
|
||||
|
||||
- name: Fail if required settings not defined
|
||||
- name: Fail if required honoroit settings not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item }}`).
|
||||
when: "vars[item] == ''"
|
||||
You need to define a required configuration setting (`{{ item.name }}`).
|
||||
when: "item.when | bool and vars[item.name] == ''"
|
||||
with_items:
|
||||
- "matrix_bot_honoroit_password"
|
||||
- "matrix_bot_honoroit_roomid"
|
||||
- {'name': 'matrix_bot_honoroit_password', when: true}
|
||||
- {'name': 'matrix_bot_honoroit_roomid', when: true}
|
||||
- {'name': 'matrix_bot_honoroit_database_hostname', when: "{{ matrix_bot_honoroit_database_engine == 'postgres' }}"}
|
||||
|
@ -1,5 +0,0 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-matrix-registration-bot.service'] }}"
|
||||
when: matrix_bot_matrix_registration_bot_enabled | bool
|
@ -1,23 +1,20 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
- block:
|
||||
- when: matrix_bot_matrix_registration_bot_enabled | bool
|
||||
ansible.builtin.include_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: matrix_bot_matrix_registration_bot_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-matrix-registration-bot
|
||||
- install-all
|
||||
- install-bot-matrix-registration-bot
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_bot_matrix_registration_bot_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-matrix-registration-bot
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_bot_matrix_registration_bot_enabled | bool"
|
||||
- block:
|
||||
- when: not matrix_bot_matrix_registration_bot_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-matrix-registration-bot
|
||||
|
@ -61,14 +61,3 @@
|
||||
src: "{{ role_path }}/templates/systemd/matrix-bot-matrix-registration-bot.service.j2"
|
||||
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-matrix-registration-bot.service"
|
||||
mode: 0644
|
||||
register: matrix_bot_matrix_registration_bot_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-bot-matrix-registration-bot.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_matrix_registration_bot_systemd_service_result.changed | bool"
|
||||
|
||||
- name: Ensure matrix-bot-matrix-registration-bot.service restarted, if necessary
|
||||
ansible.builtin.service:
|
||||
name: "matrix-bot-matrix-registration-bot.service"
|
||||
state: restarted
|
||||
|
@ -5,32 +5,21 @@
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-matrix-registration-bot.service"
|
||||
register: matrix_bot_matrix_registration_bot_service_stat
|
||||
|
||||
- name: Ensure matrix-matrix-registration-bot is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-bot-matrix-registration-bot
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
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
|
||||
block:
|
||||
- name: Ensure matrix-matrix-registration-bot is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-bot-matrix-registration-bot
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Ensure matrix-bot-matrix-registration-bot.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-matrix-registration-bot.service"
|
||||
state: absent
|
||||
when: "matrix_bot_matrix_registration_bot_service_stat.stat.exists | bool"
|
||||
- name: Ensure matrix-bot-matrix-registration-bot.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-matrix-registration-bot.service"
|
||||
state: absent
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-bot-matrix-registration-bot.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_matrix_registration_bot_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure Matrix matrix-registration-bot paths don't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_bot_matrix_registration_bot_base_path }}"
|
||||
state: absent
|
||||
|
||||
- name: Ensure matrix-registration-bot Docker image doesn't exist
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_bot_matrix_registration_bot_docker_image }}"
|
||||
state: absent
|
||||
- name: Ensure Matrix matrix-registration-bot paths don't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_bot_matrix_registration_bot_base_path }}"
|
||||
state: absent
|
||||
|
@ -44,7 +44,7 @@ matrix_bot_matrix_reminder_bot_sqlite_database_path_in_container: "/data/bot.db"
|
||||
|
||||
matrix_bot_matrix_reminder_bot_database_username: 'matrix_reminder_bot'
|
||||
matrix_bot_matrix_reminder_bot_database_password: 'some-password'
|
||||
matrix_bot_matrix_reminder_bot_database_hostname: 'matrix-postgres'
|
||||
matrix_bot_matrix_reminder_bot_database_hostname: ''
|
||||
matrix_bot_matrix_reminder_bot_database_port: 5432
|
||||
matrix_bot_matrix_reminder_bot_database_name: 'matrix_reminder_bot'
|
||||
|
||||
|
@ -1,5 +0,0 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-matrix-reminder-bot.service'] }}"
|
||||
when: matrix_bot_matrix_reminder_bot_enabled | bool
|
@ -1,23 +1,20 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
- block:
|
||||
- when: matrix_bot_matrix_reminder_bot_enabled | bool
|
||||
ansible.builtin.include_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: matrix_bot_matrix_reminder_bot_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-matrix-reminder-bot
|
||||
- install-all
|
||||
- install-bot-matrix-reminder-bot
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_bot_matrix_reminder_bot_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-matrix-reminder-bot
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_bot_matrix_reminder_bot_enabled | bool"
|
||||
- block:
|
||||
- when: not matrix_bot_matrix_reminder_bot_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-matrix-reminder-bot
|
||||
|
@ -12,8 +12,11 @@
|
||||
|
||||
- when: "matrix_bot_matrix_reminder_bot_sqlite_database_path_local_stat_result.stat.exists | bool"
|
||||
block:
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_postgres_db_migration_request:
|
||||
- ansible.builtin.include_role:
|
||||
name: galaxy/com.devture.ansible.role.postgres
|
||||
tasks_from: migrate_db_to_postgres
|
||||
vars:
|
||||
devture_postgres_db_migration_request:
|
||||
src: "{{ matrix_bot_matrix_reminder_bot_sqlite_database_path_local }}"
|
||||
dst: "{{ matrix_bot_matrix_reminder_bot_database_connection_string }}"
|
||||
caller: "{{ role_path | basename }}"
|
||||
@ -21,10 +24,6 @@
|
||||
engine_old: 'sqlite'
|
||||
systemd_services_to_stop: ['matrix-bot-matrix-reminder-bot.service']
|
||||
|
||||
- ansible.builtin.import_role:
|
||||
name: custom/matrix-postgres
|
||||
tasks_from: migrate_db_to_postgres
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_bot_matrix_reminder_bot_requires_restart: true
|
||||
|
||||
@ -92,13 +91,9 @@
|
||||
mode: 0644
|
||||
register: matrix_bot_matrix_reminder_bot_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-bot-matrix-reminder-bot.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_matrix_reminder_bot_systemd_service_result.changed | bool"
|
||||
|
||||
- name: Ensure matrix-bot-matrix-reminder-bot.service restarted, if necessary
|
||||
ansible.builtin.service:
|
||||
name: "matrix-bot-matrix-reminder-bot.service"
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_matrix_reminder_bot_requires_restart | bool"
|
||||
|
@ -5,32 +5,21 @@
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-matrix-reminder-bot.service"
|
||||
register: matrix_bot_matrix_reminder_bot_service_stat
|
||||
|
||||
- name: Ensure matrix-matrix-reminder-bot is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-bot-matrix-reminder-bot
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
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
|
||||
block:
|
||||
- name: Ensure matrix-matrix-reminder-bot is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-bot-matrix-reminder-bot
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Ensure matrix-bot-matrix-reminder-bot.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-matrix-reminder-bot.service"
|
||||
state: absent
|
||||
when: "matrix_bot_matrix_reminder_bot_service_stat.stat.exists | bool"
|
||||
- name: Ensure matrix-bot-matrix-reminder-bot.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-matrix-reminder-bot.service"
|
||||
state: absent
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-bot-matrix-reminder-bot.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_matrix_reminder_bot_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure Matrix matrix-reminder-bot paths don't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_bot_matrix_reminder_bot_base_path }}"
|
||||
state: absent
|
||||
|
||||
- name: Ensure matrix-reminder-bot Docker image doesn't exist
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_bot_matrix_reminder_bot_docker_image }}"
|
||||
state: absent
|
||||
- name: Ensure Matrix matrix-reminder-bot paths don't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_bot_matrix_reminder_bot_base_path }}"
|
||||
state: absent
|
||||
|
@ -1,15 +1,16 @@
|
||||
---
|
||||
|
||||
- name: Fail if required settings not defined
|
||||
- name: Fail if required matrix-reminder-bot settings not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item }}`).
|
||||
when: "vars[item] == ''"
|
||||
when: "item.when | bool and vars[item.name] == ''"
|
||||
with_items:
|
||||
- "matrix_bot_matrix_reminder_bot_matrix_user_password"
|
||||
- "matrix_bot_matrix_reminder_bot_reminders_timezone"
|
||||
- {'name': 'matrix_bot_matrix_reminder_bot_matrix_user_password', when: true}
|
||||
- {'name': 'matrix_bot_matrix_reminder_bot_reminders_timezone', when: true}
|
||||
- {'name': 'matrix_bot_matrix_reminder_bot_database_hostname', when: "{{ matrix_bot_matrix_reminder_bot_database_engine == 'postgres' }}"}
|
||||
|
||||
- name: (Deprecation) Catch and report renamed settings
|
||||
- name: (Deprecation) Catch and report renamed matrix-reminder-bot settings
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
Your configuration contains a variable, which now has a different name.
|
||||
|
@ -27,7 +27,7 @@ matrix_bot_maubot_sqlite_database_path_in_container: "/data/maubot.db"
|
||||
|
||||
matrix_bot_maubot_database_username: matrix_bot_maubot
|
||||
matrix_bot_maubot_database_password: ~
|
||||
matrix_bot_maubot_database_hostname: 'matrix-postgres'
|
||||
matrix_bot_maubot_database_hostname: ''
|
||||
matrix_bot_maubot_database_port: 5432
|
||||
matrix_bot_maubot_database_name: matrix_bot_maubot
|
||||
|
||||
|
@ -1,10 +1,5 @@
|
||||
---
|
||||
|
||||
- name: Add maubot to the systemd service list
|
||||
ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-maubot.service'] }}"
|
||||
when: matrix_bot_maubot_enabled | bool
|
||||
|
||||
- name: Configure nginx for maubot
|
||||
block:
|
||||
- name: Generate Maubot proxying configuration for matrix-nginx-proxy
|
@ -1,23 +1,29 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
- block:
|
||||
- when: matrix_bot_maubot_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/inject_into_nginx_proxy.yml"
|
||||
tags:
|
||||
- always
|
||||
- setup-all
|
||||
- setup-nginx-proxy
|
||||
- install-all
|
||||
- install-nginx-proxy
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup|bool and matrix_bot_maubot_enabled|bool"
|
||||
- block:
|
||||
- when: matrix_bot_maubot_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
|
||||
- when: matrix_bot_maubot_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-maubot
|
||||
- install-all
|
||||
- install-bot-maubot
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup|bool and matrix_bot_maubot_enabled|bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-maubot
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup|bool and not matrix_bot_maubot_enabled|bool"
|
||||
- block:
|
||||
- when: not matrix_bot_maubot_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-maubot
|
||||
|
@ -65,9 +65,3 @@
|
||||
src: "{{ role_path }}/templates/systemd/matrix-bot-maubot.service.j2"
|
||||
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-maubot.service"
|
||||
mode: 0644
|
||||
register: matrix_bot_maubot_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-bot-maubot.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_maubot_systemd_service_result.changed|bool"
|
||||
|
@ -5,32 +5,21 @@
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-maubot.service"
|
||||
register: matrix_bot_maubot_service_stat
|
||||
|
||||
- name: Ensure matrix-bot-maubot is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-bot-maubot
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
register: stopping_result
|
||||
when: "matrix_bot_maubot_service_stat.stat.exists | bool"
|
||||
- when: matrix_bot_maubot_service_stat.stat.exists | bool
|
||||
block:
|
||||
- name: Ensure matrix-bot-maubot is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-bot-maubot
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Ensure matrix-bot-maubot.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-maubot.service"
|
||||
state: absent
|
||||
when: "matrix_bot_maubot_service_stat.stat.exists | bool"
|
||||
- name: Ensure matrix-bot-maubot.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-maubot.service"
|
||||
state: absent
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-bot-maubot.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_maubot_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure Matrix maubot paths don't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_bot_maubot_base_path }}"
|
||||
state: absent
|
||||
|
||||
- name: Ensure maubot Docker image doesn't exist
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_bot_maubot_docker_image }}"
|
||||
state: absent
|
||||
- name: Ensure Matrix maubot paths don't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_bot_maubot_base_path }}"
|
||||
state: absent
|
||||
|
@ -1,10 +1,11 @@
|
||||
---
|
||||
|
||||
- name: Fail if required settings not defined
|
||||
- name: Fail if required maubot settings not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item }}`).
|
||||
when: "vars[item] == ''"
|
||||
You need to define a required configuration setting (`{{ item.name }}`).
|
||||
when: "item.when | bool and vars[item.name] == ''"
|
||||
with_items:
|
||||
- matrix_bot_maubot_unshared_secret
|
||||
- matrix_bot_maubot_admins
|
||||
- {'name': 'matrix_bot_maubot_unshared_secret', when: true}
|
||||
- {'name': 'matrix_bot_maubot_admins', when: true}
|
||||
- {'name': 'matrix_bot_maubot_database_hostname', when: "{{ matrix_bot_maubot_database_engine == 'postgres' }}"}
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
matrix_bot_mjolnir_enabled: true
|
||||
|
||||
matrix_bot_mjolnir_version: "v1.5.0"
|
||||
matrix_bot_mjolnir_version: "v1.6.1"
|
||||
|
||||
matrix_bot_mjolnir_container_image_self_build: false
|
||||
matrix_bot_mjolnir_container_image_self_build_repo: "https://github.com/matrix-org/mjolnir.git"
|
||||
|
@ -1,11 +0,0 @@
|
||||
---
|
||||
# See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070
|
||||
# and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407
|
||||
- name: Fail if trying to self-build on Ansible < 2.8
|
||||
ansible.builtin.fail:
|
||||
msg: "To self-build the Mjolnir image, you should use Ansible 2.8 or higher. See docs/ansible.md"
|
||||
when: "ansible_version.major == 2 and ansible_version.minor < 8 and matrix_bot_mjolnir_container_image_self_build and matrix_bot_mjolnir_enabled"
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-mjolnir.service'] }}"
|
||||
when: matrix_bot_mjolnir_enabled | bool
|
@ -1,23 +1,20 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
- block:
|
||||
- when: matrix_bot_mjolnir_enabled | bool
|
||||
ansible.builtin.include_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: matrix_bot_mjolnir_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-mjolnir
|
||||
- install-all
|
||||
- install-bot-mjolnir
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_bot_mjolnir_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-mjolnir
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_bot_mjolnir_enabled | bool"
|
||||
- block:
|
||||
- when: not matrix_bot_mjolnir_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-mjolnir
|
||||
|
@ -66,13 +66,9 @@
|
||||
mode: 0644
|
||||
register: matrix_bot_mjolnir_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-bot-mjolnir.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_mjolnir_systemd_service_result.changed | bool"
|
||||
|
||||
- name: Ensure matrix-bot-mjolnir.service restarted, if necessary
|
||||
ansible.builtin.service:
|
||||
name: "matrix-bot-mjolnir.service"
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_mjolnir_requires_restart | bool"
|
||||
|
@ -5,32 +5,21 @@
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-mjolnir.service"
|
||||
register: matrix_bot_mjolnir_service_stat
|
||||
|
||||
- name: Ensure matrix-bot-mjolnir is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-bot-mjolnir
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
register: stopping_result
|
||||
when: "matrix_bot_mjolnir_service_stat.stat.exists | bool"
|
||||
- when: matrix_bot_mjolnir_service_stat.stat.exists | bool
|
||||
block:
|
||||
- name: Ensure matrix-bot-mjolnir is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-bot-mjolnir
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Ensure matrix-bot-mjolnir.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-mjolnir.service"
|
||||
state: absent
|
||||
when: "matrix_bot_mjolnir_service_stat.stat.exists | bool"
|
||||
- name: Ensure matrix-bot-mjolnir.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-mjolnir.service"
|
||||
state: absent
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-bot-mjolnir.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_mjolnir_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure matrix-bot-mjolnir paths don't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_bot_mjolnir_base_path }}"
|
||||
state: absent
|
||||
|
||||
- name: Ensure mjolnir Docker image doesn't exist
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_bot_mjolnir_docker_image }}"
|
||||
state: absent
|
||||
- name: Ensure matrix-bot-mjolnir paths don't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_bot_mjolnir_base_path }}"
|
||||
state: absent
|
||||
|
@ -9,7 +9,7 @@ matrix_bot_postmoogle_docker_repo: "https://gitlab.com/etke.cc/postmoogle.git"
|
||||
matrix_bot_postmoogle_docker_repo_version: "{{ 'main' if matrix_bot_postmoogle_version == 'latest' else matrix_bot_postmoogle_version }}"
|
||||
matrix_bot_postmoogle_docker_src_files_path: "{{ matrix_base_data_path }}/postmoogle/docker-src"
|
||||
|
||||
matrix_bot_postmoogle_version: v0.9.8
|
||||
matrix_bot_postmoogle_version: v0.9.10
|
||||
matrix_bot_postmoogle_docker_image: "{{ matrix_bot_postmoogle_docker_image_name_prefix }}postmoogle:{{ matrix_bot_postmoogle_version }}"
|
||||
matrix_bot_postmoogle_docker_image_name_prefix: "{{ 'localhost/' if matrix_bot_postmoogle_container_image_self_build else 'registry.gitlab.com/etke.cc/' }}"
|
||||
matrix_bot_postmoogle_docker_image_force_pull: "{{ matrix_bot_postmoogle_docker_image.endswith(':latest') }}"
|
||||
@ -42,7 +42,7 @@ matrix_bot_postmoogle_sqlite_database_path_in_container: "/data/bot.db"
|
||||
|
||||
matrix_bot_postmoogle_database_username: 'postmoogle'
|
||||
matrix_bot_postmoogle_database_password: 'some-password'
|
||||
matrix_bot_postmoogle_database_hostname: 'matrix-postgres'
|
||||
matrix_bot_postmoogle_database_hostname: ''
|
||||
matrix_bot_postmoogle_database_port: 5432
|
||||
matrix_bot_postmoogle_database_name: 'postmoogle'
|
||||
|
||||
@ -78,18 +78,6 @@ matrix_bot_postmoogle_prefix: '!pm'
|
||||
# Max email size in megabytes, including attachments
|
||||
matrix_bot_postmoogle_maxsize: '1024'
|
||||
|
||||
# DEPRECATED, use !pm users instead
|
||||
# A list of whitelisted users allowed to use the bridge.
|
||||
# If not defined, everyone is allowed.
|
||||
# Example set of rules:
|
||||
# matrix_bot_postmoogle_users:
|
||||
# - @someone:example.com
|
||||
# - @another:example.com
|
||||
# - @bot.*:example.com
|
||||
# - @*:another.com
|
||||
matrix_bot_postmoogle_users:
|
||||
- "@*:{{ matrix_domain }}"
|
||||
|
||||
# A list of admins
|
||||
# Example set of rules:
|
||||
# matrix_bot_postmoogle_admins:
|
||||
@ -99,17 +87,29 @@ matrix_bot_postmoogle_users:
|
||||
# - @*:another.com
|
||||
matrix_bot_postmoogle_admins: "{{ [matrix_admin] if matrix_admin else [] }}"
|
||||
|
||||
# Sentry DSN
|
||||
# Sentry DSN. Deprecated, use matrix_bot_postmoogle_monitoring_sentry_dsn
|
||||
matrix_bot_postmoogle_sentry: ''
|
||||
|
||||
# Sentry integration
|
||||
matrix_bot_postmoogle_monitoring_sentry_dsn: "{{ matrix_bot_postmoogle_sentry }}"
|
||||
matrix_bot_postmoogle_monitoring_sentry_rate: 20
|
||||
|
||||
# healthchecks.io integration
|
||||
matrix_bot_postmoogle_monitoring_healthchecks_uuid: ''
|
||||
matrix_bot_postmoogle_monitoring_healthchecks_duration: 60
|
||||
|
||||
# Log level
|
||||
matrix_bot_postmoogle_loglevel: 'INFO'
|
||||
|
||||
# Disable encryption
|
||||
matrix_bot_postmoogle_noencryption: false
|
||||
|
||||
# deprecated, use matrix_bot_postmoogle_domains
|
||||
matrix_bot_postmoogle_domain: "{{ matrix_server_fqn_matrix }}"
|
||||
|
||||
matrix_bot_postmoogle_domains:
|
||||
- "{{ matrix_bot_postmoogle_domain }}" # backward compatibility
|
||||
|
||||
# Password (passphrase) to encrypt account data
|
||||
matrix_bot_postmoogle_data_secret: ""
|
||||
|
||||
@ -126,15 +126,15 @@ matrix_bot_postmoogle_submission_host_bind_port: '587'
|
||||
matrix_bot_postmoogle_ssl_path: ""
|
||||
|
||||
## in-container SSL paths
|
||||
# matrix_bot_postmoogle_tls_cert is the SSL certificate's certificate.
|
||||
# This is likely set via group_vars/matrix_servers, so you don't need to set it.
|
||||
# matrix_bot_postmoogle_tls_cert is the SSL certificates' certificates.
|
||||
# This var is likely set via group_vars/matrix_servers, so you don't need to set certs manually.
|
||||
# If you do need to set it manually, note that this is an in-container path.
|
||||
# To mount a certificates volumes into the container, use matrix_bot_postmoogle_ssl_path
|
||||
# Example value: /ssl/live/{{ matrix_bot_postmoogle_domain }}/fullchain.pem
|
||||
matrix_bot_postmoogle_tls_cert: ""
|
||||
|
||||
# matrix_bot_postmoogle_tls_key is the SSL certificate's key.
|
||||
# This is likely set via group_vars/matrix_servers, so you don't need to set it.
|
||||
# matrix_bot_postmoogle_tls_key is the SSL certificates' keys.
|
||||
# This var is likely set via group_vars/matrix_servers, so you don't need to set keys manually.
|
||||
# If you do need to set it manually, note that this is an in-container path.
|
||||
# To mount a certificates volumes into the container, use matrix_bot_postmoogle_ssl_path
|
||||
# Example value: /ssl/live/{{ matrix_bot_postmoogle_domain }}/privkey.pem
|
||||
@ -143,6 +143,15 @@ matrix_bot_postmoogle_tls_key: ""
|
||||
# Mandatory TLS, even on plain SMTP port
|
||||
matrix_bot_postmoogle_tls_required: false
|
||||
|
||||
# trusted proxies
|
||||
matrix_bot_postmoogle_proxies: []
|
||||
|
||||
# reserved mailboxes
|
||||
matrix_bot_postmoogle_mailboxes_reserved: []
|
||||
|
||||
# mailbox activation flow
|
||||
matrix_bot_postmoogle_mailboxes_activation: none
|
||||
|
||||
# Additional environment variables to pass to the postmoogle container
|
||||
#
|
||||
# Example:
|
||||
|
@ -1,5 +0,0 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-postmoogle.service'] }}"
|
||||
when: matrix_bot_postmoogle_enabled | bool
|
@ -1,23 +1,20 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
- block:
|
||||
- when: matrix_bot_postmoogle_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup | bool and matrix_bot_postmoogle_enabled | bool"
|
||||
- when: matrix_bot_postmoogle_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-postmoogle
|
||||
- install-all
|
||||
- install-bot-postmoogle
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_bot_postmoogle_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-postmoogle
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_bot_postmoogle_enabled | bool"
|
||||
- block:
|
||||
- when: not matrix_bot_postmoogle_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-bot-postmoogle
|
||||
|
@ -8,8 +8,11 @@
|
||||
|
||||
- when: "matrix_bot_postmoogle_sqlite_database_path_local_stat_result.stat.exists | bool"
|
||||
block:
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_postgres_db_migration_request:
|
||||
- ansible.builtin.include_role:
|
||||
name: galaxy/com.devture.ansible.role.postgres
|
||||
tasks_from: migrate_db_to_postgres
|
||||
vars:
|
||||
devture_postgres_db_migration_request:
|
||||
src: "{{ matrix_bot_postmoogle_sqlite_database_path_local }}"
|
||||
dst: "{{ matrix_bot_postmoogle_database_connection_string }}"
|
||||
caller: "{{ role_path | basename }}"
|
||||
@ -17,10 +20,6 @@
|
||||
engine_old: 'sqlite'
|
||||
systemd_services_to_stop: ['matrix-bot-postmoogle.service']
|
||||
|
||||
- ansible.builtin.import_role:
|
||||
name: custom/matrix-postgres
|
||||
tasks_from: migrate_db_to_postgres
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_bot_postmoogle_requires_restart: true
|
||||
|
||||
@ -86,8 +85,3 @@
|
||||
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-postmoogle.service"
|
||||
mode: 0644
|
||||
register: matrix_bot_postmoogle_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-bot-postmoogle.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_postmoogle_systemd_service_result.changed | bool"
|
||||
|
@ -5,32 +5,21 @@
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-postmoogle.service"
|
||||
register: matrix_bot_postmoogle_service_stat
|
||||
|
||||
- name: Ensure matrix-postmoogle is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-bot-postmoogle
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
register: stopping_result
|
||||
when: "matrix_bot_postmoogle_service_stat.stat.exists | bool"
|
||||
- when: matrix_bot_postmoogle_service_stat.stat.exists | bool
|
||||
block:
|
||||
- name: Ensure matrix-postmoogle is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-bot-postmoogle
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Ensure matrix-bot-postmoogle.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-postmoogle.service"
|
||||
state: absent
|
||||
when: "matrix_bot_postmoogle_service_stat.stat.exists | bool"
|
||||
- name: Ensure matrix-bot-postmoogle.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-postmoogle.service"
|
||||
state: absent
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-bot-postmoogle.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_bot_postmoogle_service_stat.stat.exists | bool"
|
||||
|
||||
- name: Ensure Matrix postmoogle paths don't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_bot_postmoogle_base_path }}"
|
||||
state: absent
|
||||
|
||||
- name: Ensure postmoogle Docker image doesn't exist
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_bot_postmoogle_docker_image }}"
|
||||
state: absent
|
||||
- name: Ensure Matrix postmoogle paths don't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_bot_postmoogle_base_path }}"
|
||||
state: absent
|
||||
|
@ -1,9 +1,10 @@
|
||||
---
|
||||
|
||||
- name: Fail if required settings not defined
|
||||
- name: Fail if required Postmoogle settings not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item }}`).
|
||||
when: "vars[item] == ''"
|
||||
You need to define a required configuration setting (`{{ item.name }}`).
|
||||
when: "item.when | bool and vars[item.name] == ''"
|
||||
with_items:
|
||||
- "matrix_bot_postmoogle_password"
|
||||
- {'name': 'matrix_bot_postmoogle_password', when: true}
|
||||
- {'name': 'matrix_bot_postmoogle_database_hostname', when: "{{ matrix_bot_postmoogle_database_engine == 'postgres' }}"}
|
||||
|
@ -1,13 +1,12 @@
|
||||
POSTMOOGLE_LOGIN={{ matrix_bot_postmoogle_login }}
|
||||
POSTMOOGLE_PASSWORD={{ matrix_bot_postmoogle_password }}
|
||||
POSTMOOGLE_HOMESERVER={{ matrix_bot_postmoogle_homeserver }}
|
||||
POSTMOOGLE_DOMAIN={{ matrix_bot_postmoogle_domain }}
|
||||
POSTMOOGLE_DOMAINS={{ matrix_bot_postmoogle_domains | join(' ') }}
|
||||
POSTMOOGLE_PORT={{ matrix_bot_postmoogle_port }}
|
||||
POSTMOOGLE_DB_DSN={{ matrix_bot_postmoogle_database_connection_string }}
|
||||
POSTMOOGLE_DB_DIALECT={{ matrix_bot_postmoogle_database_dialect }}
|
||||
POSTMOOGLE_PREFIX={{ matrix_bot_postmoogle_prefix }}
|
||||
POSTMOOGLE_MAXSIZE={{ matrix_bot_postmoogle_maxsize }}
|
||||
POSTMOOGLE_SENTRY={{ matrix_bot_postmoogle_sentry }}
|
||||
POSTMOOGLE_LOGLEVEL={{ matrix_bot_postmoogle_loglevel }}
|
||||
POSTMOOGLE_NOENCRYPTION={{ matrix_bot_postmoogle_noencryption }}
|
||||
POSTMOOGLE_ADMINS={{ matrix_bot_postmoogle_admins | join(' ') }}
|
||||
@ -16,5 +15,12 @@ POSTMOOGLE_TLS_CERT={{ matrix_bot_postmoogle_tls_cert }}
|
||||
POSTMOOGLE_TLS_KEY={{ matrix_bot_postmoogle_tls_key }}
|
||||
POSTMOOGLE_TLS_REQUIRED={{ matrix_bot_postmoogle_tls_required }}
|
||||
POSTMOOGLE_DATA_SECRET={{ matrix_bot_postmoogle_data_secret }}
|
||||
POSTMOOGLE_PROXIES={{ matrix_bot_postmoogle_proxies | join(' ') }}
|
||||
POSTMOOGLE_MONITORING_SENTRY_DSN={{ matrix_bot_postmoogle_monitoring_sentry_dsn }}
|
||||
POSTMOOGLE_MONITORING_SENTRY_RATE={{ matrix_bot_postmoogle_monitoring_sentry_rate }}
|
||||
POSTMOOGLE_MONITORING_HEALTHCHECKS_UUID={{ matrix_bot_postmoogle_monitoring_healthchecks_uuid }}
|
||||
POSTMOOGLE_MONITORING_HEALTHCHECKS_DURATION={{ matrix_bot_postmoogle_monitoring_healthchecks_duration }}
|
||||
POSTMOOGLE_MAILBOXES_RESERVED={{ matrix_bot_postmoogle_mailboxes_reserved | join(' ') }}
|
||||
POSTMOOGLE_MAILBOXES_ACTIVATION={{ matrix_bot_postmoogle_mailboxes_activation }}
|
||||
|
||||
{{ matrix_bot_postmoogle_environment_variables_extension }}
|
||||
|
@ -60,7 +60,7 @@ matrix_appservice_discord_sqlite_database_path_in_container: "/data/discord.db"
|
||||
|
||||
matrix_appservice_discord_database_username: 'matrix_appservice_discord'
|
||||
matrix_appservice_discord_database_password: 'some-password'
|
||||
matrix_appservice_discord_database_hostname: 'matrix-postgres'
|
||||
matrix_appservice_discord_database_hostname: ''
|
||||
matrix_appservice_discord_database_port: 5432
|
||||
matrix_appservice_discord_database_name: 'matrix_appservice_discord'
|
||||
|
||||
|
@ -1,29 +0,0 @@
|
||||
---
|
||||
# If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist.
|
||||
# We don't want to fail in such cases.
|
||||
- name: Fail if matrix-synapse role already executed
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
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)"
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-appservice-discord.service'] }}"
|
||||
when: matrix_appservice_discord_enabled | bool
|
||||
|
||||
# If the matrix-synapse role is not used, these variables may not exist.
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_homeserver_container_runtime_injected_arguments: >
|
||||
{{
|
||||
matrix_homeserver_container_runtime_injected_arguments | default([])
|
||||
+
|
||||
["--mount type=bind,src={{ matrix_appservice_discord_config_path }}/registration.yaml,dst=/matrix-appservice-discord-registration.yaml,ro"]
|
||||
}}
|
||||
|
||||
matrix_homeserver_app_service_runtime_injected_config_files: >
|
||||
{{
|
||||
matrix_homeserver_app_service_runtime_injected_config_files | default([])
|
||||
+
|
||||
["/matrix-appservice-discord-registration.yaml"]
|
||||
}}
|
||||
when: matrix_appservice_discord_enabled | bool
|
@ -1,23 +1,20 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
- block:
|
||||
- when: matrix_appservice_discord_enabled | bool
|
||||
ansible.builtin.include_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: matrix_appservice_discord_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-appservice-discord
|
||||
- install-all
|
||||
- install-appservice-discord
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_appservice_discord_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-appservice-discord
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_appservice_discord_enabled | bool"
|
||||
- block:
|
||||
- when: not matrix_appservice_discord_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-appservice-discord
|
||||
|
@ -12,8 +12,11 @@
|
||||
|
||||
- when: "matrix_appservice_discord_sqlite_database_path_local_stat_result.stat.exists | bool"
|
||||
block:
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_postgres_db_migration_request:
|
||||
- ansible.builtin.include_role:
|
||||
name: galaxy/com.devture.ansible.role.postgres
|
||||
tasks_from: migrate_db_to_postgres
|
||||
vars:
|
||||
devture_postgres_db_migration_request:
|
||||
src: "{{ matrix_appservice_discord_sqlite_database_path_local }}"
|
||||
dst: "{{ matrix_appservice_discord_database_connString }}"
|
||||
caller: "{{ role_path | basename }}"
|
||||
@ -21,10 +24,6 @@
|
||||
engine_old: 'sqlite'
|
||||
systemd_services_to_stop: ['matrix-appservice-discord.service']
|
||||
|
||||
- ansible.builtin.import_role:
|
||||
name: custom/matrix-postgres
|
||||
tasks_from: migrate_db_to_postgres
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_appservice_discord_requires_restart: true
|
||||
|
||||
@ -109,13 +108,9 @@
|
||||
mode: 0644
|
||||
register: matrix_appservice_discord_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-appservice-discord.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_appservice_discord_systemd_service_result.changed"
|
||||
|
||||
- name: Ensure matrix-appservice-discord.service restarted, if necessary
|
||||
ansible.builtin.service:
|
||||
name: "matrix-appservice-discord.service"
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
when: "matrix_appservice_discord_requires_restart | bool"
|
||||
|
@ -5,21 +5,16 @@
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-discord.service"
|
||||
register: matrix_appservice_discord_service_stat
|
||||
|
||||
- name: Ensure matrix-appservice-discord is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-appservice-discord
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
when: "matrix_appservice_discord_service_stat.stat.exists"
|
||||
- when: matrix_appservice_discord_service_stat.stat.exists | bool
|
||||
block:
|
||||
- name: Ensure matrix-appservice-discord is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-appservice-discord
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Ensure matrix-appservice-discord.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-discord.service"
|
||||
state: absent
|
||||
when: "matrix_appservice_discord_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-appservice-discord.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_appservice_discord_service_stat.stat.exists"
|
||||
- name: Ensure matrix-appservice-discord.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-discord.service"
|
||||
state: absent
|
||||
|
@ -1,16 +1,17 @@
|
||||
---
|
||||
|
||||
- name: Fail if required settings not defined
|
||||
- name: Fail if required appservice-discord settings not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item }}`).
|
||||
when: "vars[item] == ''"
|
||||
You need to define a required configuration setting (`{{ item.name }}`).
|
||||
when: "item.when | bool and vars[item.name] == ''"
|
||||
with_items:
|
||||
- "matrix_appservice_discord_client_id"
|
||||
- "matrix_appservice_discord_bot_token"
|
||||
- "matrix_appservice_discord_appservice_token"
|
||||
- "matrix_appservice_discord_homeserver_token"
|
||||
- "matrix_appservice_discord_homeserver_domain"
|
||||
- {'name': 'matrix_appservice_discord_client_id', when: true}
|
||||
- {'name': 'matrix_appservice_discord_bot_token', when: true}
|
||||
- {'name': 'matrix_appservice_discord_appservice_token', when: true}
|
||||
- {'name': 'matrix_appservice_discord_homeserver_token', when: true}
|
||||
- {'name': 'matrix_appservice_discord_homeserver_domain', when: true}
|
||||
- {'name': 'matrix_appservice_discord_database_hostname', when: "{{ matrix_appservice_discord_database_engine == 'postgres' }}"}
|
||||
|
||||
- name: (Deprecation) Catch and report renamed appservice-discord variables
|
||||
ansible.builtin.fail:
|
||||
|
@ -29,8 +29,8 @@ matrix_appservice_irc_appservice_address: 'http://matrix-appservice-irc:9999'
|
||||
|
||||
matrix_appservice_irc_database_engine: nedb
|
||||
matrix_appservice_irc_database_username: matrix_appservice_irc
|
||||
matrix_appservice_irc_database_password: ~
|
||||
matrix_appservice_irc_database_hostname: 'matrix-postgres'
|
||||
matrix_appservice_irc_database_password: 'some-password'
|
||||
matrix_appservice_irc_database_hostname: ''
|
||||
matrix_appservice_irc_database_port: 5432
|
||||
matrix_appservice_irc_database_name: matrix_appservice_irc
|
||||
|
||||
|
@ -1,36 +0,0 @@
|
||||
---
|
||||
# See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070
|
||||
# and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407
|
||||
- name: Fail if trying to self-build on Ansible < 2.8
|
||||
ansible.builtin.fail:
|
||||
msg: "To self-build the matrix-appservice-irc image, you should use Ansible 2.8 or higher. See docs/ansible.md"
|
||||
when: "ansible_version.major == 2 and ansible_version.minor < 8 and matrix_appservice_irc_container_image_self_build and matrix_appservice_irc_enabled"
|
||||
|
||||
# If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist.
|
||||
# We don't want to fail in such cases.
|
||||
- name: Fail if matrix-synapse role already executed
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
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)"
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-appservice-irc.service'] }}"
|
||||
when: matrix_appservice_irc_enabled | bool
|
||||
|
||||
# If the matrix-synapse role is not used, these variables may not exist.
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_homeserver_container_runtime_injected_arguments: >
|
||||
{{
|
||||
matrix_homeserver_container_runtime_injected_arguments | default([])
|
||||
+
|
||||
["--mount type=bind,src={{ matrix_appservice_irc_config_path }}/registration.yaml,dst=/matrix-appservice-irc-registration.yaml,ro"]
|
||||
}}
|
||||
|
||||
matrix_homeserver_app_service_runtime_injected_config_files: >
|
||||
{{
|
||||
matrix_homeserver_app_service_runtime_injected_config_files | default([])
|
||||
+
|
||||
["/matrix-appservice-irc-registration.yaml"]
|
||||
}}
|
||||
when: matrix_appservice_irc_enabled | bool
|
@ -1,23 +1,20 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
- block:
|
||||
- when: matrix_appservice_irc_enabled | bool
|
||||
ansible.builtin.include_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: matrix_appservice_irc_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-appservice-irc
|
||||
- install-all
|
||||
- install-appservice-irc
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_appservice_irc_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-appservice-irc
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_appservice_irc_enabled | bool"
|
||||
- block:
|
||||
- when: not matrix_appservice_irc_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-appservice-irc
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
- name: Fail if Postgres not enabled
|
||||
ansible.builtin.fail:
|
||||
msg: "Postgres via the matrix-postgres role is not enabled (`matrix_postgres_enabled`). Cannot migrate."
|
||||
when: "not matrix_postgres_enabled | bool"
|
||||
msg: "Postgres via the com.devture.ansible.role.postgres role is not enabled (`devture_postgres_enabled`). Cannot migrate."
|
||||
when: "not devture_postgres_enabled | bool"
|
||||
|
||||
# Defaults
|
||||
|
||||
@ -14,19 +14,19 @@
|
||||
|
||||
# Actual import work
|
||||
|
||||
- name: Ensure matrix-postgres is started
|
||||
- name: Ensure Postgres is started
|
||||
ansible.builtin.service:
|
||||
name: matrix-postgres
|
||||
name: "{{ devture_postgres_identifier }}"
|
||||
state: started
|
||||
daemon_reload: true
|
||||
register: matrix_postgres_service_start_result
|
||||
register: postgres_service_start_result
|
||||
|
||||
- name: Wait a bit, so that Postgres can start
|
||||
ansible.builtin.wait_for:
|
||||
timeout: "{{ postgres_start_wait_time }}"
|
||||
delegate_to: 127.0.0.1
|
||||
become: false
|
||||
when: "matrix_postgres_service_start_result.changed | bool"
|
||||
when: postgres_service_start_result.changed | bool
|
||||
|
||||
- name: Check existence of matrix-appservice-irc service
|
||||
ansible.builtin.stat:
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_role:
|
||||
- ansible.builtin.include_role:
|
||||
name: custom/matrix-base
|
||||
tasks_from: ensure_openssl_installed
|
||||
|
||||
@ -60,7 +60,7 @@
|
||||
|
||||
- when: "matrix_appservice_irc_nedb_database_path_local_stat_result.stat.exists | bool"
|
||||
block:
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/migrate_nedb_to_postgres.yml"
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/migrate_nedb_to_postgres.yml"
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_appservice_irc_requires_restart: true
|
||||
@ -199,13 +199,9 @@
|
||||
mode: 0644
|
||||
register: matrix_appservice_irc_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-appservice-irc.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_appservice_irc_systemd_service_result.changed"
|
||||
|
||||
- name: Ensure matrix-appservice-irc.service restarted, if necessary
|
||||
ansible.builtin.service:
|
||||
name: "matrix-appservice-irc.service"
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
when: "matrix_appservice_irc_requires_restart | bool"
|
||||
|
@ -5,21 +5,16 @@
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-irc.service"
|
||||
register: matrix_appservice_irc_service_stat
|
||||
|
||||
- name: Ensure matrix-appservice-irc is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-appservice-irc
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
when: "matrix_appservice_irc_service_stat.stat.exists"
|
||||
- when: matrix_appservice_irc_service_stat.stat.exists | bool
|
||||
block:
|
||||
- name: Ensure matrix-appservice-irc is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-appservice-irc
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Ensure matrix-appservice-irc.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-irc.service"
|
||||
state: absent
|
||||
when: "matrix_appservice_irc_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-appservice-irc.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_appservice_irc_service_stat.stat.exists"
|
||||
- name: Ensure matrix-appservice-irc.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-irc.service"
|
||||
state: absent
|
||||
|
@ -3,11 +3,12 @@
|
||||
- name: Fail if required settings not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item }}`).
|
||||
when: "vars[item] == ''"
|
||||
You need to define a required configuration setting (`{{ item.name }}`).
|
||||
when: "item.when | bool and vars[item.name] == ''"
|
||||
with_items:
|
||||
- "matrix_appservice_irc_appservice_token"
|
||||
- "matrix_appservice_irc_homeserver_token"
|
||||
- {'name': 'matrix_appservice_irc_appservice_token', when: true}
|
||||
- {'name': 'matrix_appservice_irc_homeserver_token', when: true}
|
||||
- {'name': 'matrix_appservice_irc_database_hostname', when: "{{ matrix_appservice_irc_database_engine == 'postgres' }}"}
|
||||
|
||||
# Our base configuration (`matrix_appservice_irc_configuration_yaml`) is not enough to
|
||||
# let the playbook run without errors.
|
||||
|
@ -90,7 +90,7 @@ matrix_appservice_kakaotalk_sqlite_database_path_in_container: "/data/appservice
|
||||
|
||||
matrix_appservice_kakaotalk_database_username: 'matrix_appservice_kakaotalk'
|
||||
matrix_appservice_kakaotalk_database_password: 'some-password'
|
||||
matrix_appservice_kakaotalk_database_hostname: 'matrix-postgres'
|
||||
matrix_appservice_kakaotalk_database_hostname: ''
|
||||
matrix_appservice_kakaotalk_database_port: 5432
|
||||
matrix_appservice_kakaotalk_database_name: 'matrix_appservice_kakaotalk'
|
||||
|
||||
|
@ -1,28 +0,0 @@
|
||||
---
|
||||
# See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070
|
||||
# and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407
|
||||
- name: Fail if trying to self-build on Ansible < 2.8
|
||||
ansible.builtin.fail:
|
||||
msg: "To self-build the appservice-kakaotalk image, you should use Ansible 2.8 or higher. See docs/ansible.md"
|
||||
when: "ansible_version.major == 2 and ansible_version.minor < 8 and matrix_appservice_kakaotalk_container_image_self_build and matrix_appservice_kakaotalk_enabled"
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-appservice-kakaotalk.service', 'matrix-appservice-kakaotalk-node.service'] }}"
|
||||
when: matrix_appservice_kakaotalk_enabled | bool
|
||||
|
||||
# If the matrix-synapse role is not used, these variables may not exist.
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_homeserver_container_runtime_injected_arguments: >
|
||||
{{
|
||||
matrix_homeserver_container_runtime_injected_arguments | default([])
|
||||
+
|
||||
["--mount type=bind,src={{ matrix_appservice_kakaotalk_config_path }}/registration.yaml,dst=/matrix-appservice-kakaotalk-registration.yaml,ro"]
|
||||
}}
|
||||
|
||||
matrix_homeserver_app_service_runtime_injected_config_files: >
|
||||
{{
|
||||
matrix_homeserver_app_service_runtime_injected_config_files | default([])
|
||||
+
|
||||
["/matrix-appservice-kakaotalk-registration.yaml"]
|
||||
}}
|
||||
when: matrix_appservice_kakaotalk_enabled | bool
|
@ -1,23 +1,20 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
- block:
|
||||
- when: matrix_appservice_kakaotalk_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup | bool and matrix_appservice_kakaotalk_enabled | bool"
|
||||
- when: matrix_appservice_kakaotalk_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-appservice-kakaotalk
|
||||
- install-all
|
||||
- install-appservice-kakaotalk
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_appservice_kakaotalk_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-appservice-kakaotalk
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_appservice_kakaotalk_enabled | bool"
|
||||
- block:
|
||||
- when: not matrix_appservice_kakaotalk_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-appservice-kakaotalk
|
||||
|
@ -1,13 +1,5 @@
|
||||
---
|
||||
|
||||
# If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist.
|
||||
# We don't want to fail in such cases.
|
||||
- name: Fail if matrix-synapse role already executed
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
The matrix-bridge-matrix-appservice-kakaotalk role needs to execute before the matrix-synapse role.
|
||||
when: "matrix_synapse_role_executed | default(False)"
|
||||
|
||||
- name: Ensure matrix-appservice-kakaotalk image is pulled
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_appservice_kakaotalk_docker_image }}"
|
||||
@ -117,9 +109,3 @@
|
||||
src: "{{ role_path }}/templates/systemd/matrix-appservice-kakaotalk.service.j2"
|
||||
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-kakaotalk.service"
|
||||
mode: 0644
|
||||
register: matrix_appservice_kakaotalk_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-appservice-kakaotalk.service or matrix-appservice-kakaotalk-node.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: matrix_appservice_kakaotalk_node_systemd_service_result.changed or matrix_appservice_kakaotalk_systemd_service_result.changed
|
||||
|
@ -11,7 +11,7 @@
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
when: "matrix_appservice_kakaotalk_service_stat.stat.exists"
|
||||
when: matrix_appservice_kakaotalk_service_stat.stat.exists | bool
|
||||
|
||||
- name: Check existence of matrix-appservice-kakaotalk-node service
|
||||
ansible.builtin.stat:
|
||||
@ -24,7 +24,7 @@
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
when: "matrix_appservice_kakaotalk_node_service_stat.stat.exists"
|
||||
when: matrix_appservice_kakaotalk_node_service_stat.stat.exists | bool
|
||||
|
||||
- name: Ensure matrix-appservice-kakaotalk.service files don't exist
|
||||
ansible.builtin.file:
|
||||
@ -33,9 +33,4 @@
|
||||
with_items:
|
||||
- "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-kakaotalk-node.service"
|
||||
- "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-kakaotalk.service"
|
||||
when: "matrix_appservice_kakaotalk_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-appservice-kakaotalk service files removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_appservice_kakaotalk_service_stat.stat.exists or matrix_appservice_kakaotalk_node_service_stat.stat.exists"
|
||||
when: matrix_appservice_kakaotalk_service_stat.stat.exists | bool or matrix_appservice_kakaotalk_node_service_stat.stat.exists | bool
|
||||
|
@ -1,10 +1,11 @@
|
||||
---
|
||||
|
||||
- name: Fail if required settings not defined
|
||||
- name: Fail if required appservice-kakaotalk settings not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item }}`).
|
||||
when: "vars[item] == ''"
|
||||
You need to define a required configuration setting (`{{ item.name }}`).
|
||||
when: "item.when | bool and vars[item.name] == ''"
|
||||
with_items:
|
||||
- "matrix_appservice_kakaotalk_appservice_token"
|
||||
- "matrix_appservice_kakaotalk_homeserver_token"
|
||||
- {'name': 'matrix_appservice_kakaotalk_appservice_token', when: true}
|
||||
- {'name': 'matrix_appservice_kakaotalk_homeserver_token', when: true}
|
||||
- {'name': 'matrix_appservice_kakaotalk_database_hostname', when: "{{ matrix_appservice_kakaotalk_database_engine == 'postgres' }}"}
|
||||
|
@ -230,8 +230,8 @@ bridge:
|
||||
# $message - The message content
|
||||
message_formats:
|
||||
m.text: '<b>$sender_displayname</b>: $message'
|
||||
m.notice: '<b>$sender_displayname<b>: $message'
|
||||
m.emote: '* <b>$sender_displayname<b> $message'
|
||||
m.notice: '<b>$sender_displayname</b>: $message'
|
||||
m.emote: '* <b>$sender_displayname</b> $message'
|
||||
m.file: 'File from <b>$sender_displayname</b>: $message'
|
||||
m.image: 'Image from <b>$sender_displayname</b>: $message'
|
||||
m.audio: 'Audio from <b>$sender_displayname</b>: $message'
|
||||
|
@ -11,7 +11,7 @@ matrix_appservice_slack_docker_src_files_path: "{{ matrix_base_data_path }}/apps
|
||||
|
||||
# matrix_appservice_slack_version used to contain the full Docker image tag (e.g. `release-X.X.X`).
|
||||
# It's a bare version number now. We try to somewhat retain compatibility below.
|
||||
matrix_appservice_slack_version: 2.0.1
|
||||
matrix_appservice_slack_version: 2.0.2
|
||||
matrix_appservice_slack_docker_image: "{{ matrix_container_global_registry_prefix }}matrixdotorg/matrix-appservice-slack:{{ matrix_appservice_slack_docker_image_tag }}"
|
||||
matrix_appservice_slack_docker_image_tag: "{{ 'latest' if matrix_appservice_slack_version == 'latest' else ('release-' + matrix_appservice_slack_version) }}"
|
||||
matrix_appservice_slack_docker_image_force_pull: "{{ matrix_appservice_slack_docker_image.endswith(':latest') }}"
|
||||
@ -57,8 +57,8 @@ matrix_appservice_slack_id_token: ''
|
||||
|
||||
matrix_appservice_slack_database_engine: nedb
|
||||
matrix_appservice_slack_database_username: matrix_appservice_slack
|
||||
matrix_appservice_slack_database_password: ~
|
||||
matrix_appservice_slack_database_hostname: 'matrix-postgres'
|
||||
matrix_appservice_slack_database_password: 'some-passsword'
|
||||
matrix_appservice_slack_database_hostname: ''
|
||||
matrix_appservice_slack_database_port: 5432
|
||||
matrix_appservice_slack_database_name: matrix_appservice_slack
|
||||
|
||||
|
@ -1,91 +0,0 @@
|
||||
---
|
||||
# See https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1070
|
||||
# and https://github.com/spantaleev/matrix-docker-ansible-deploy/commit/1ab507349c752042d26def3e95884f6df8886b74#commitcomment-51108407
|
||||
- name: Fail if trying to self-build on Ansible < 2.8
|
||||
ansible.builtin.fail:
|
||||
msg: "To self-build the matrix-appservice-slack image, you should use Ansible 2.8 or higher. See docs/ansible.md"
|
||||
when: "ansible_version.major == 2 and ansible_version.minor < 8 and matrix_appservice_slack_container_image_self_build and matrix_appservice_slack_enabled"
|
||||
|
||||
# If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist.
|
||||
# We don't want to fail in such cases.
|
||||
- name: Fail if matrix-synapse role already executed
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
The matrix-bridge-appservice-slack role needs to execute before the matrix-synapse role.
|
||||
when: "matrix_synapse_role_executed | default(False)"
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-appservice-slack.service'] }}"
|
||||
when: matrix_appservice_slack_enabled | bool
|
||||
|
||||
# If the matrix-synapse role is not used, these variables may not exist.
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_homeserver_container_runtime_injected_arguments: >
|
||||
{{
|
||||
matrix_homeserver_container_runtime_injected_arguments | default([])
|
||||
+
|
||||
["--mount type=bind,src={{ matrix_appservice_slack_config_path }}/slack-registration.yaml,dst=/matrix-appservice-slack-registration.yaml,ro"]
|
||||
}}
|
||||
|
||||
matrix_homeserver_app_service_runtime_injected_config_files: >
|
||||
{{
|
||||
matrix_homeserver_app_service_runtime_injected_config_files | default([])
|
||||
+
|
||||
["/matrix-appservice-slack-registration.yaml"]
|
||||
}}
|
||||
when: matrix_appservice_slack_enabled | bool
|
||||
|
||||
# If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist.
|
||||
# We don't want to fail in such cases.
|
||||
- name: Fail if matrix-synapse role already executed
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
The matrix-bridge-appservice-slack role needs to execute before the matrix-synapse role.
|
||||
when: "matrix_synapse_role_executed | default(False)"
|
||||
|
||||
- when: matrix_appservice_slack_enabled | bool
|
||||
tags:
|
||||
- always
|
||||
block:
|
||||
- name: Fail if matrix-nginx-proxy role already executed
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
Trying to append Slack Appservice's reverse-proxying configuration to matrix-nginx-proxy,
|
||||
but it's pointless since the matrix-nginx-proxy role had already executed.
|
||||
To fix this, please change the order of roles in your playbook,
|
||||
so that the matrix-nginx-proxy role would run after the matrix-bridge-appservice-slack role.
|
||||
when: matrix_nginx_proxy_role_executed | default(False) | bool
|
||||
|
||||
- name: Generate Matrix Appservice Slack proxying configuration for matrix-nginx-proxy
|
||||
ansible.builtin.set_fact:
|
||||
matrix_appservice_slack_matrix_nginx_proxy_configuration: |
|
||||
location {{ matrix_appservice_slack_public_endpoint }} {
|
||||
{% if matrix_nginx_proxy_enabled | default(False) %}
|
||||
{# Use the embedded DNS resolver in Docker containers to discover the service #}
|
||||
resolver 127.0.0.11 valid=5s;
|
||||
set $backend "{{ matrix_appservice_slack_appservice_url }}:{{ matrix_appservice_slack_slack_port }}";
|
||||
proxy_pass $backend;
|
||||
{% else %}
|
||||
{# Generic configuration for use outside of our container setup #}
|
||||
proxy_pass http://127.0.0.1:{{ matrix_appservice_slack_slack_port }};
|
||||
{% endif %}
|
||||
}
|
||||
|
||||
- name: Register Slack Appservice proxying configuration with matrix-nginx-proxy
|
||||
ansible.builtin.set_fact:
|
||||
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: |
|
||||
{{
|
||||
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks | default([])
|
||||
+
|
||||
[matrix_appservice_slack_matrix_nginx_proxy_configuration]
|
||||
}}
|
||||
|
||||
- name: Warn about reverse-proxying if matrix-nginx-proxy not used
|
||||
ansible.builtin.debug:
|
||||
msg: >-
|
||||
NOTE: You've enabled the Matrix Slack bridge but are not using the matrix-nginx-proxy
|
||||
reverse proxy.
|
||||
Please make sure that you're proxying the `{{ matrix_appservice_slack_public_endpoint }}`
|
||||
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.
|
||||
when: "matrix_appservice_slack_enabled | bool and not matrix_nginx_proxy_enabled | default(False) | bool"
|
@ -0,0 +1,44 @@
|
||||
---
|
||||
|
||||
- name: Fail if matrix-nginx-proxy role already executed
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
Trying to append Slack Appservice's reverse-proxying configuration to matrix-nginx-proxy,
|
||||
but it's pointless since the matrix-nginx-proxy role had already executed.
|
||||
To fix this, please change the order of roles in your playbook,
|
||||
so that the matrix-nginx-proxy role would run after the matrix-bridge-appservice-slack role.
|
||||
when: matrix_nginx_proxy_role_executed | default(False) | bool
|
||||
|
||||
- name: Generate Matrix Appservice Slack proxying configuration for matrix-nginx-proxy
|
||||
ansible.builtin.set_fact:
|
||||
matrix_appservice_slack_matrix_nginx_proxy_configuration: |
|
||||
location {{ matrix_appservice_slack_public_endpoint }} {
|
||||
{% if matrix_nginx_proxy_enabled | default(False) %}
|
||||
{# Use the embedded DNS resolver in Docker containers to discover the service #}
|
||||
resolver 127.0.0.11 valid=5s;
|
||||
set $backend "{{ matrix_appservice_slack_appservice_url }}:{{ matrix_appservice_slack_slack_port }}";
|
||||
proxy_pass $backend;
|
||||
{% else %}
|
||||
{# Generic configuration for use outside of our container setup #}
|
||||
proxy_pass http://127.0.0.1:{{ matrix_appservice_slack_slack_port }};
|
||||
{% endif %}
|
||||
}
|
||||
|
||||
- name: Register Slack Appservice proxying configuration with matrix-nginx-proxy
|
||||
ansible.builtin.set_fact:
|
||||
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: |
|
||||
{{
|
||||
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks | default([])
|
||||
+
|
||||
[matrix_appservice_slack_matrix_nginx_proxy_configuration]
|
||||
}}
|
||||
|
||||
- name: Warn about reverse-proxying if matrix-nginx-proxy not used
|
||||
ansible.builtin.debug:
|
||||
msg: >-
|
||||
NOTE: You've enabled the Matrix Slack bridge but are not using the matrix-nginx-proxy
|
||||
reverse proxy.
|
||||
Please make sure that you're proxying the `{{ matrix_appservice_slack_public_endpoint }}`
|
||||
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.
|
||||
when: "matrix_appservice_slack_enabled | bool and not matrix_nginx_proxy_enabled | default(False) | bool"
|
@ -1,23 +1,29 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
- block:
|
||||
- when: matrix_appservice_slack_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/inject_into_nginx_proxy.yml"
|
||||
tags:
|
||||
- always
|
||||
- setup-all
|
||||
- setup-nginx-proxy
|
||||
- install-all
|
||||
- install-nginx-proxy
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup | bool and matrix_appservice_slack_enabled | bool"
|
||||
- block:
|
||||
- when: matrix_appservice_slack_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
|
||||
- when: matrix_appservice_slack_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-appservice-slack
|
||||
- install-all
|
||||
- install-appservice-slack
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_appservice_slack_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-appservice-slack
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_appservice_slack_enabled | bool"
|
||||
- block:
|
||||
- when: not matrix_appservice_slack_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-appservice-slack
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
- name: Fail if Postgres not enabled
|
||||
ansible.builtin.fail:
|
||||
msg: "Postgres via the matrix-postgres role is not enabled (`matrix_postgres_enabled`). Cannot migrate."
|
||||
when: "not matrix_postgres_enabled | bool"
|
||||
msg: "Postgres via the com.devture.ansible.role.postgres role is not enabled (`devture_postgres_enabled`). Cannot migrate."
|
||||
when: "not devture_postgres_enabled | bool"
|
||||
|
||||
# Defaults
|
||||
|
||||
@ -14,19 +14,19 @@
|
||||
|
||||
# Actual import work
|
||||
|
||||
- name: Ensure matrix-postgres is started
|
||||
- name: Ensure Postgres is started
|
||||
ansible.builtin.service:
|
||||
name: matrix-postgres
|
||||
name: "{{ devture_postgres_identifier }}"
|
||||
state: started
|
||||
daemon_reload: true
|
||||
register: matrix_postgres_service_start_result
|
||||
register: postgres_service_start_result
|
||||
|
||||
- name: Wait a bit, so that Postgres can start
|
||||
ansible.builtin.wait_for:
|
||||
timeout: "{{ postgres_start_wait_time }}"
|
||||
delegate_to: 127.0.0.1
|
||||
become: false
|
||||
when: "matrix_postgres_service_start_result.changed | bool"
|
||||
when: "postgres_service_start_result.changed | bool"
|
||||
|
||||
- name: Ensure matrix-appservice-slack is stopped
|
||||
ansible.builtin.service:
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
- when: "matrix_appservice_slack_nedb_database_path_local_stat_result.stat.exists | bool"
|
||||
block:
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/migrate_nedb_to_postgres.yml"
|
||||
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/migrate_nedb_to_postgres.yml"
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_appservice_slack_requires_restart: true
|
||||
@ -87,15 +87,10 @@
|
||||
src: "{{ role_path }}/templates/systemd/matrix-appservice-slack.service.j2"
|
||||
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-slack.service"
|
||||
mode: 0644
|
||||
register: matrix_appservice_slack_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-appservice-slack.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_appservice_slack_systemd_service_result.changed"
|
||||
|
||||
- name: Ensure matrix-appservice-slack.service restarted, if necessary
|
||||
ansible.builtin.service:
|
||||
name: "matrix-appservice-slack.service"
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
when: "matrix_appservice_slack_requires_restart | bool"
|
||||
|
@ -5,21 +5,16 @@
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-slack.service"
|
||||
register: matrix_appservice_slack_service_stat
|
||||
|
||||
- name: Ensure matrix-appservice-slack is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-appservice-slack
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
when: "matrix_appservice_slack_service_stat.stat.exists"
|
||||
- when: matrix_appservice_slack_service_stat.stat.exists | bool
|
||||
block:
|
||||
- name: Ensure matrix-appservice-slack is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-appservice-slack
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
|
||||
- name: Ensure matrix-appservice-slack.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-slack.service"
|
||||
state: absent
|
||||
when: "matrix_appservice_slack_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-appservice-slack.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_appservice_slack_service_stat.stat.exists"
|
||||
- name: Ensure matrix-appservice-slack.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-appservice-slack.service"
|
||||
state: absent
|
||||
|
@ -1,16 +1,17 @@
|
||||
---
|
||||
|
||||
- name: Fail if required settings not defined
|
||||
- name: Fail if required appservice-slack settings not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item }}`).
|
||||
when: "vars[item] == ''"
|
||||
You need to define a required configuration setting (`{{ item.name }}`).
|
||||
when: "item.when | bool and vars[item.name] == ''"
|
||||
with_items:
|
||||
- "matrix_appservice_slack_control_room_id"
|
||||
- "matrix_appservice_slack_appservice_token"
|
||||
- "matrix_appservice_slack_homeserver_url"
|
||||
- "matrix_appservice_slack_homeserver_token"
|
||||
- "matrix_appservice_slack_id_token"
|
||||
- {'name': 'matrix_appservice_slack_control_room_id', when: true}
|
||||
- {'name': 'matrix_appservice_slack_appservice_token', when: true}
|
||||
- {'name': 'matrix_appservice_slack_homeserver_url', when: true}
|
||||
- {'name': 'matrix_appservice_slack_homeserver_token', when: true}
|
||||
- {'name': 'matrix_appservice_slack_id_token', when: true}
|
||||
- {'name': 'matrix_appservice_slack_database_hostname', when: "{{ matrix_appservice_slack_database_engine == 'postgres' }}"}
|
||||
|
||||
- name: (Deprecation) Catch and report renamed settings
|
||||
ansible.builtin.fail:
|
||||
|
@ -1,86 +0,0 @@
|
||||
---
|
||||
# If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist.
|
||||
# We don't want to fail in such cases.
|
||||
- name: Fail if matrix-synapse role already executed
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
The matrix-bridge-appservice-webhooks role needs to execute before the matrix-synapse role.
|
||||
when: "matrix_synapse_role_executed | default(False)"
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-appservice-webhooks.service'] }}"
|
||||
when: matrix_appservice_webhooks_enabled | bool
|
||||
|
||||
# If the matrix-synapse role is not used, these variables may not exist.
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_homeserver_container_runtime_injected_arguments: >
|
||||
{{
|
||||
matrix_homeserver_container_runtime_injected_arguments | default([])
|
||||
+
|
||||
["--mount type=bind,src={{ matrix_appservice_webhooks_config_path }}/webhooks-registration.yaml,dst=/matrix-appservice-webhooks-registration.yaml,ro"]
|
||||
}}
|
||||
|
||||
matrix_homeserver_app_service_runtime_injected_config_files: >
|
||||
{{
|
||||
matrix_homeserver_app_service_runtime_injected_config_files | default([])
|
||||
+
|
||||
["/matrix-appservice-webhooks-registration.yaml"]
|
||||
}}
|
||||
when: matrix_appservice_webhooks_enabled | bool
|
||||
|
||||
# If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist.
|
||||
# We don't want to fail in such cases.
|
||||
- name: Fail if matrix-synapse role already executed
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
The matrix-bridge-appservice-webhooks role needs to execute before the matrix-synapse role.
|
||||
when: "matrix_synapse_role_executed | default(False)"
|
||||
|
||||
- when: matrix_appservice_webhooks_enabled | bool
|
||||
tags:
|
||||
- always
|
||||
block:
|
||||
- name: Fail if matrix-nginx-proxy role already executed
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
Trying to append webhooks Appservice's reverse-proxying configuration to matrix-nginx-proxy,
|
||||
but it's pointless since the matrix-nginx-proxy role had already executed.
|
||||
To fix this, please change the order of roles in your playbook,
|
||||
so that the matrix-nginx-proxy role would run after the matrix-bridge-appservice-webhooks role.
|
||||
when: matrix_nginx_proxy_role_executed | default(False) | bool
|
||||
|
||||
- name: Generate Matrix Appservice webhooks proxying configuration for matrix-nginx-proxy
|
||||
ansible.builtin.set_fact:
|
||||
matrix_appservice_webhooks_matrix_nginx_proxy_configuration: |
|
||||
{% if matrix_nginx_proxy_enabled | default(False) %}
|
||||
{# Use the embedded DNS resolver in Docker containers to discover the service #}
|
||||
location ~ ^{{ matrix_appservice_webhooks_public_endpoint }}/(.*)$ {
|
||||
resolver 127.0.0.11 valid=5s;
|
||||
set $backend "matrix-appservice-webhooks:{{ matrix_appservice_webhooks_matrix_port }}";
|
||||
proxy_pass http://$backend/$1;
|
||||
}
|
||||
{% else %}
|
||||
{# Generic configuration for use outside of our container setup #}
|
||||
location {{ matrix_appservice_webhooks_public_endpoint }}/ {
|
||||
proxy_pass http://127.0.0.1:{{ matrix_appservice_webhooks_matrix_port }}/;
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
- name: Register webhooks Appservice proxying configuration with matrix-nginx-proxy
|
||||
ansible.builtin.set_fact:
|
||||
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: |
|
||||
{{
|
||||
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks | default([])
|
||||
+
|
||||
[matrix_appservice_webhooks_matrix_nginx_proxy_configuration]
|
||||
}}
|
||||
|
||||
- name: Warn about reverse-proxying if matrix-nginx-proxy not used
|
||||
ansible.builtin.debug:
|
||||
msg: >-
|
||||
NOTE: You've enabled the Matrix webhooks bridge but are not using the matrix-nginx-proxy
|
||||
reverse proxy.
|
||||
Please make sure that you're proxying the `{{ matrix_appservice_webhooks_public_endpoint }}`
|
||||
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.
|
||||
when: "matrix_appservice_webhooks_enabled | bool and not matrix_nginx_proxy_enabled | default(False) | bool"
|
@ -0,0 +1,46 @@
|
||||
---
|
||||
|
||||
- name: Fail if matrix-nginx-proxy role already executed
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
Trying to append webhooks Appservice's reverse-proxying configuration to matrix-nginx-proxy,
|
||||
but it's pointless since the matrix-nginx-proxy role had already executed.
|
||||
To fix this, please change the order of roles in your playbook,
|
||||
so that the matrix-nginx-proxy role would run after the matrix-bridge-appservice-webhooks role.
|
||||
when: matrix_nginx_proxy_role_executed | default(False) | bool
|
||||
|
||||
- name: Generate Matrix Appservice webhooks proxying configuration for matrix-nginx-proxy
|
||||
ansible.builtin.set_fact:
|
||||
matrix_appservice_webhooks_matrix_nginx_proxy_configuration: |
|
||||
{% if matrix_nginx_proxy_enabled | default(False) %}
|
||||
{# Use the embedded DNS resolver in Docker containers to discover the service #}
|
||||
location ~ ^{{ matrix_appservice_webhooks_public_endpoint }}/(.*)$ {
|
||||
resolver 127.0.0.11 valid=5s;
|
||||
set $backend "matrix-appservice-webhooks:{{ matrix_appservice_webhooks_matrix_port }}";
|
||||
proxy_pass http://$backend/$1;
|
||||
}
|
||||
{% else %}
|
||||
{# Generic configuration for use outside of our container setup #}
|
||||
location {{ matrix_appservice_webhooks_public_endpoint }}/ {
|
||||
proxy_pass http://127.0.0.1:{{ matrix_appservice_webhooks_matrix_port }}/;
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
- name: Register webhooks Appservice proxying configuration with matrix-nginx-proxy
|
||||
ansible.builtin.set_fact:
|
||||
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: |
|
||||
{{
|
||||
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks | default([])
|
||||
+
|
||||
[matrix_appservice_webhooks_matrix_nginx_proxy_configuration]
|
||||
}}
|
||||
|
||||
- name: Warn about reverse-proxying if matrix-nginx-proxy not used
|
||||
ansible.builtin.debug:
|
||||
msg: >-
|
||||
NOTE: You've enabled the Matrix webhooks bridge but are not using the matrix-nginx-proxy
|
||||
reverse proxy.
|
||||
Please make sure that you're proxying the `{{ matrix_appservice_webhooks_public_endpoint }}`
|
||||
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.
|
||||
when: "matrix_appservice_webhooks_enabled | bool and not matrix_nginx_proxy_enabled | default(False) | bool"
|
@ -1,23 +1,29 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
- block:
|
||||
- when: matrix_appservice_webhooks_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/inject_into_nginx_proxy.yml"
|
||||
tags:
|
||||
- always
|
||||
- setup-all
|
||||
- setup-nginx-proxy
|
||||
- install-all
|
||||
- install-nginx-proxy
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup | bool and matrix_appservice_webhooks_enabled | bool"
|
||||
- block:
|
||||
- when: matrix_appservice_webhooks_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
|
||||
- when: matrix_appservice_webhooks_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-appservice-webhooks
|
||||
- install-all
|
||||
- install-appservice-webhooks
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup | bool and matrix_appservice_webhooks_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-appservice-webhooks
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup | bool and not matrix_appservice_webhooks_enabled | bool"
|
||||
- block:
|
||||
- when: not matrix_appservice_webhooks_enabled | bool
|
||||
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-appservice-webhooks
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user