From 139c574cdbbbed4e2642500eb2ec618a5c0a63ee Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Fri, 7 Jan 2022 12:40:56 +0200 Subject: [PATCH] Move checks from unused validate_config.yml file elsewhere --- roles/matrix-base/tasks/sanity_check.yml | 8 ++++++-- roles/matrix-base/tasks/validate_config.yml | 10 ---------- 2 files changed, 6 insertions(+), 12 deletions(-) delete mode 100644 roles/matrix-base/tasks/validate_config.yml diff --git a/roles/matrix-base/tasks/sanity_check.yml b/roles/matrix-base/tasks/sanity_check.yml index 298a994c..f78510d7 100644 --- a/roles/matrix-base/tasks/sanity_check.yml +++ b/roles/matrix-base/tasks/sanity_check.yml @@ -39,9 +39,11 @@ msg: | The `matrix_homeserver_generic_secret_key` variable must be defined and have a non-null and non-empty value. - If you're seeing this error on an existing homeserver installation, you can fix it easily this error by adding + If you're observing this error on a new installation, you should ensure that the `matrix_homeserver_generic_secret_key` is defined. + + 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 %}` - to your vars.yml file. Using another secret for the new variable is also possible and shouldn't cause any trouble. + to your `vars.yml` file. Using another secret value for the new variable is also possible and shouldn't cause any trouble. when: "matrix_homeserver_generic_secret_key is none or matrix_homeserver_generic_secret_key == ''" - name: Fail if required variables are undefined @@ -51,6 +53,8 @@ - {'var': matrix_domain, 'value': "{{ matrix_domain|default('') }}"} - {'var': matrix_server_fqn_matrix, 'value': "{{ matrix_server_fqn_matrix|default('') }}"} - {'var': matrix_server_fqn_element, 'value': "{{ matrix_server_fqn_element|default('') }}"} + - {'var': matrix_homeserver_container_url, 'value': "{{ matrix_homeserver_container_url|default('') }}"} + - {'var': matrix_homeserver_container_federation_url, 'value': "{{ matrix_homeserver_container_federation_url|default('') }}"} when: "item.value is none or item.value == ''" - name: Fail if uppercase domain used diff --git a/roles/matrix-base/tasks/validate_config.yml b/roles/matrix-base/tasks/validate_config.yml deleted file mode 100644 index 84ef2f06..00000000 --- a/roles/matrix-base/tasks/validate_config.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- - -- name: Fail if required Matrix Base settings not defined - fail: - msg: >- - You need to define a required configuration setting (`{{ item }}`) for using this playbook. - when: "vars[item] == ''" - with_items: - - "matrix_homeserver_container_url" - - "matrix_homeserver_container_federation_url"