From 4d881477a34a144a8d31d6c47825a752376019d1 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Wed, 23 Nov 2022 16:56:39 +0200 Subject: [PATCH] Add matrix_homeserver_enabled variable We need this to control whether `('matrix-' + matrix_homeserver_implementation + '.service')` would get injected into `devture_systemd_service_manager_services_list_auto` --- group_vars/matrix_servers | 2 +- roles/custom/matrix-base/defaults/main.yml | 10 ++++++++++ roles/custom/matrix-base/tasks/main.yml | 2 +- .../tasks/{sanity_check.yml => validate_config.yml} | 0 4 files changed, 12 insertions(+), 2 deletions(-) rename roles/custom/matrix-base/tasks/{sanity_check.yml => validate_config.yml} (100%) diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index c2ed002c..b53ad0e8 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -249,7 +249,7 @@ devture_systemd_service_manager_services_list_auto: | + ([{'name': 'matrix-client-hydrogen.service', 'priority': 2000, 'groups': ['matrix', 'clients', 'hydrogen']}] if matrix_client_hydrogen_enabled else []) + - ([{'name': ('matrix-' + matrix_homeserver_implementation + '.service'), 'priority': 1000, 'groups': ['matrix', 'homeservers', matrix_homeserver_implementation]}]) + ([{'name': ('matrix-' + matrix_homeserver_implementation + '.service'), 'priority': 1000, 'groups': ['matrix', 'homeservers', matrix_homeserver_implementation]}] if matrix_homeserver_enabled else []) + ([{'name': 'matrix-corporal.service', 'priority': 1500, 'groups': ['matrix', 'corporal']}] if matrix_corporal_enabled else []) + diff --git a/roles/custom/matrix-base/defaults/main.yml b/roles/custom/matrix-base/defaults/main.yml index 768bc6ec..34d8c65b 100644 --- a/roles/custom/matrix-base/defaults/main.yml +++ b/roles/custom/matrix-base/defaults/main.yml @@ -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:`). # @@ -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: diff --git a/roles/custom/matrix-base/tasks/main.yml b/roles/custom/matrix-base/tasks/main.yml index 67a3208e..97f0381d 100644 --- a/roles/custom/matrix-base/tasks/main.yml +++ b/roles/custom/matrix-base/tasks/main.yml @@ -1,6 +1,6 @@ --- -- ansible.builtin.import_tasks: "{{ role_path }}/tasks/sanity_check.yml" +- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml" tags: - setup-all diff --git a/roles/custom/matrix-base/tasks/sanity_check.yml b/roles/custom/matrix-base/tasks/validate_config.yml similarity index 100% rename from roles/custom/matrix-base/tasks/sanity_check.yml rename to roles/custom/matrix-base/tasks/validate_config.yml