From fe9b9773c06b95ab6a37fdd7d4036bb5d4c12466 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sun, 23 Dec 2018 19:14:01 +0200 Subject: [PATCH] Move setup sanity checks to a central place --- roles/matrix-server/tasks/setup/main.yml | 4 ++++ .../matrix-server/tasks/setup/setup_sanity_check.yml | 11 +++++++++++ .../tasks/setup/synapse/setup_synapse_pre.yml | 5 ----- 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 roles/matrix-server/tasks/setup/setup_sanity_check.yml diff --git a/roles/matrix-server/tasks/setup/main.yml b/roles/matrix-server/tasks/setup/main.yml index 34d7c8b86..92b5b5ff4 100644 --- a/roles/matrix-server/tasks/setup/main.yml +++ b/roles/matrix-server/tasks/setup/main.yml @@ -1,5 +1,9 @@ --- +- include: tasks/setup/setup_sanity_check.yml + tags: + - always + - include: tasks/setup/setup_base.yml tags: - setup-all diff --git a/roles/matrix-server/tasks/setup/setup_sanity_check.yml b/roles/matrix-server/tasks/setup/setup_sanity_check.yml new file mode 100644 index 000000000..a24ae1d0a --- /dev/null +++ b/roles/matrix-server/tasks/setup/setup_sanity_check.yml @@ -0,0 +1,11 @@ +--- + +- name: Fail if Macaroon key is missing + fail: + msg: "You need to set a secret in the matrix_synapse_macaroon_secret_key variable" + when: "matrix_synapse_macaroon_secret_key == ''" + +- name: Fail if Coturn Auth secret is missing + fail: + msg: "You need to set a secret in the matrix_coturn_turn_static_auth_secret variable" + when: "matrix_coturn_turn_static_auth_secret == ''" \ No newline at end of file diff --git a/roles/matrix-server/tasks/setup/synapse/setup_synapse_pre.yml b/roles/matrix-server/tasks/setup/synapse/setup_synapse_pre.yml index f05998615..2871ef269 100644 --- a/roles/matrix-server/tasks/setup/synapse/setup_synapse_pre.yml +++ b/roles/matrix-server/tasks/setup/synapse/setup_synapse_pre.yml @@ -1,10 +1,5 @@ --- -- name: Fail if Macaroon key is missing - fail: - msg: "You need to set a secret in the matrix_synapse_macaroon_secret_key variable" - when: "matrix_synapse_macaroon_secret_key == ''" - - set_fact: matrix_synapse_media_store_parent_path: "{{ matrix_synapse_media_store_path|dirname }}" matrix_synapse_media_store_directory_name: "{{ matrix_synapse_media_store_path|basename }}"