From 6b206b3763cebd721fa6cfd5e55c35685e2070e3 Mon Sep 17 00:00:00 2001 From: jakicoll Date: Mon, 6 Feb 2023 15:21:10 +0100 Subject: [PATCH] Move checks into validate_config.yml. --- .../matrix-user-verification-service/tasks/main.yml | 9 ++------- .../tasks/validate_config.yml | 8 ++++++++ 2 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 roles/custom/matrix-user-verification-service/tasks/validate_config.yml diff --git a/roles/custom/matrix-user-verification-service/tasks/main.yml b/roles/custom/matrix-user-verification-service/tasks/main.yml index 0f51d6cc..92686036 100644 --- a/roles/custom/matrix-user-verification-service/tasks/main.yml +++ b/roles/custom/matrix-user-verification-service/tasks/main.yml @@ -1,13 +1,8 @@ --- -- name: verify all necessary variables are present - assert: - that: - - matrix_user_verification_service_uvs_access_token is defined and matrix_user_verification_service_uvs_access_token|length - - matrix_user_verification_service_uvs_homeserver_url is defined and matrix_user_verification_service_uvs_homeserver_url|length - fail_msg: "Missing variable in {{ matrix_user_verification_service_ansible_name }} role" - - block: + - when: matrix_jitsi_enabled | bool + ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml" - when: run_setup | bool and matrix_user_verification_service_enabled | bool ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml" tags: diff --git a/roles/custom/matrix-user-verification-service/tasks/validate_config.yml b/roles/custom/matrix-user-verification-service/tasks/validate_config.yml new file mode 100644 index 00000000..e4349fa6 --- /dev/null +++ b/roles/custom/matrix-user-verification-service/tasks/validate_config.yml @@ -0,0 +1,8 @@ +--- + +- name: verify all necessary variables are present + assert: + that: + - matrix_user_verification_service_uvs_access_token is defined and matrix_user_verification_service_uvs_access_token|length + - matrix_user_verification_service_uvs_homeserver_url is defined and matrix_user_verification_service_uvs_homeserver_url|length + fail_msg: "Missing variable in {{ matrix_user_verification_service_ansible_name }} role"