From eed12415f99f4b5907f07a5d9f5c548576333f32 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Fri, 3 Jul 2020 13:37:20 +0500 Subject: [PATCH] Split config --- roles/matrix/tasks/synapse.yml | 6 ++++-- .../templates/synapse/{config.yml => config/other.yaml} | 0 roles/matrix/templates/synapse/matrix-synapse.service | 6 +++--- roles/matrix/vars/main.yml | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) rename roles/matrix/templates/synapse/{config.yml => config/other.yaml} (100%) diff --git a/roles/matrix/tasks/synapse.yml b/roles/matrix/tasks/synapse.yml index ccae8cd..6be6d63 100644 --- a/roles/matrix/tasks/synapse.yml +++ b/roles/matrix/tasks/synapse.yml @@ -38,6 +38,7 @@ group: '{{ matrix__synapse__group }}' with_items: - '{{ matrix__synapse__conf_dir }}' + - '{{ matrix__synapse__conf_subdir }}' - '{{ matrix__synapse__opt_dir }}' - '{{ matrix__synapse__lib_dir }}' - '{{ matrix__synapse__log_dir }}' @@ -46,12 +47,13 @@ - name: Create Matrix Synapse config template: - src: '../templates/synapse/config.yml' - dest: '{{ matrix__synapse__conf_file }}' + src: '../templates/synapse/config/{{ item }}.yaml' + dest: '{{ matrix__synapse__conf_subdir }}/{{ item }}.yaml' mode: 'u=rw,g=rw,o=' owner: '{{ matrix__synapse__user }}' group: '{{ matrix__synapse__group }}' notify: Load, enable and restart Matrix Synapse + with_items: [other] - name: Create Matrix Synapse log config template: diff --git a/roles/matrix/templates/synapse/config.yml b/roles/matrix/templates/synapse/config/other.yaml similarity index 100% rename from roles/matrix/templates/synapse/config.yml rename to roles/matrix/templates/synapse/config/other.yaml diff --git a/roles/matrix/templates/synapse/matrix-synapse.service b/roles/matrix/templates/synapse/matrix-synapse.service index 4c23699..61f32fc 100644 --- a/roles/matrix/templates/synapse/matrix-synapse.service +++ b/roles/matrix/templates/synapse/matrix-synapse.service @@ -3,9 +3,9 @@ After=network.target Description=Matrix Synapse [Service] -ExecReload={{ matrix__synapse__venv_dir }}/bin/synctl restart {{ matrix__synapse__conf_file }} -ExecStart={{ matrix__synapse__venv_dir }}/bin/synctl start {{ matrix__synapse__conf_file }} -ExecStop={{ matrix__synapse__venv_dir }}/bin/synctl stop {{ matrix__synapse__conf_file }} +ExecReload={{ matrix__synapse__venv_dir }}/bin/synctl restart {{ matrix__synapse__conf_subdir }} +ExecStart={{ matrix__synapse__venv_dir }}/bin/synctl start {{ matrix__synapse__conf_subdir }} +ExecStop={{ matrix__synapse__venv_dir }}/bin/synctl stop {{ matrix__synapse__conf_subdir }} Group={{ matrix__synapse__group }} PIDFile={{ matrix__synapse__pid_file }} Restart=always diff --git a/roles/matrix/vars/main.yml b/roles/matrix/vars/main.yml index ce96dbc..4ae3d7e 100644 --- a/roles/matrix/vars/main.yml +++ b/roles/matrix/vars/main.yml @@ -22,7 +22,7 @@ matrix__synapse__run_dir: '{{ matrix__run_dir }}/synapse' matrix__static__conf_dir: '{{ matrix__conf_dir }}/static' matrix__static__opt_dir: '{{ matrix__opt_dir }}/static' -matrix__synapse__conf_file: '{{ matrix__synapse__conf_dir }}/config.yml' +matrix__synapse__conf_subdir: '{{ matrix__synapse__conf_dir }}/config' matrix__synapse__log_conf_file: '{{ matrix__synapse__conf_dir }}/log_config.yml' matrix__synapse__key_file: '{{ matrix__synapse__conf_dir }}/signing_key' matrix__synapse__venv_dir: '{{ matrix__synapse__opt_dir }}/venv'