From 47caba38fb1de77288a90afd04b9626cfacd74f6 Mon Sep 17 00:00:00 2001 From: Charles Wright Date: Fri, 5 Aug 2022 09:59:35 -0500 Subject: [PATCH] Implemented suggestions from Slavi --- roles/matrix-conduit/tasks/conduit/setup.yml | 18 +++++++++++++++++ roles/matrix-conduit/tasks/main.yml | 2 +- roles/matrix-conduit/tasks/setup_conduit.yml | 20 ------------------- .../templates/conduit/conduit.toml.j2 | 8 ++++---- 4 files changed, 23 insertions(+), 25 deletions(-) delete mode 100644 roles/matrix-conduit/tasks/setup_conduit.yml diff --git a/roles/matrix-conduit/tasks/conduit/setup.yml b/roles/matrix-conduit/tasks/conduit/setup.yml index 57aaafdff..055fbd271 100644 --- a/roles/matrix-conduit/tasks/conduit/setup.yml +++ b/roles/matrix-conduit/tasks/conduit/setup.yml @@ -1,5 +1,23 @@ --- +- name: Ensure Conduit config path exists + file: + path: "{{ matrix_conduit_config_path }}" + state: directory + mode: 0750 + owner: "{{ matrix_user_username }}" + group: "{{ matrix_user_groupname }}" + when: "matrix_conduit_enabled|bool" + +- name: Ensure Conduit data path exists + file: + path: "{{ matrix_conduit_data_path }}" + state: directory + mode: 0770 + owner: "{{ matrix_user_username }}" + group: "{{ matrix_user_groupname }}" + when: "matrix_conduit_enabled|bool" + - import_tasks: "{{ role_path }}/tasks/conduit/setup_install.yml" when: matrix_conduit_enabled|bool diff --git a/roles/matrix-conduit/tasks/main.yml b/roles/matrix-conduit/tasks/main.yml index 8ace5f48a..20d91ac8e 100644 --- a/roles/matrix-conduit/tasks/main.yml +++ b/roles/matrix-conduit/tasks/main.yml @@ -4,7 +4,7 @@ tags: - always -- import_tasks: "{{ role_path }}/tasks/setup_conduit.yml" +- import_tasks: "{{ role_path }}/tasks/conduit/setup.yml" when: run_setup|bool tags: - setup-all diff --git a/roles/matrix-conduit/tasks/setup_conduit.yml b/roles/matrix-conduit/tasks/setup_conduit.yml deleted file mode 100644 index 25632c805..000000000 --- a/roles/matrix-conduit/tasks/setup_conduit.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: Ensure Conduit config path exists - file: - path: "{{ matrix_conduit_config_path }}" - state: directory - mode: 0750 - owner: "{{ matrix_user_username }}" - group: "{{ matrix_user_groupname }}" - when: "matrix_conduit_enabled|bool" - -- name: Ensure Conduit data path exists - file: - path: "{{ matrix_conduit_data_path }}" - state: directory - mode: 0770 - owner: "{{ matrix_user_username }}" - group: "{{ matrix_user_groupname }}" - when: "matrix_conduit_enabled|bool" - -- import_tasks: "{{ role_path }}/tasks/conduit/setup.yml" diff --git a/roles/matrix-conduit/templates/conduit/conduit.toml.j2 b/roles/matrix-conduit/templates/conduit/conduit.toml.j2 index f92910e13..6f479084b 100644 --- a/roles/matrix-conduit/templates/conduit/conduit.toml.j2 +++ b/roles/matrix-conduit/templates/conduit/conduit.toml.j2 @@ -35,14 +35,14 @@ port = {{ matrix_conduit_port_number }} max_request_size = {{ matrix_conduit_max_request_size }} # Enables registration. If set to false, no users can register on this server. -allow_registration = {{ matrix_conduit_allow_registration | to_json | replace("\"", "") }} +allow_registration = {{ matrix_conduit_allow_registration | to_json }} -allow_federation = {{ matrix_conduit_allow_federation | to_json | replace("\"", "") }} +allow_federation = {{ matrix_conduit_allow_federation | to_json }} # Enable the display name lightning bolt on registration. -enable_lightning_bolt = {{ matrix_conduit_enable_lightning_bolt | to_json | replace("\"", "") }} +enable_lightning_bolt = {{ matrix_conduit_enable_lightning_bolt | to_json }} -trusted_servers = {{ matrix_conduit_trusted_servers }} +trusted_servers = {{ matrix_conduit_trusted_servers | to_json }} max_concurrent_requests = {{ matrix_conduit_max_concurrent_requests }}