From c6407998642eb5f3eb954a7e1db3664d9f562526 Mon Sep 17 00:00:00 2001 From: PC-Admin Date: Wed, 23 Feb 2022 19:52:56 +0800 Subject: [PATCH] GoMatrixHosting v0.6.9 - stop re-writing of matrix_homeserver_generic_secret_key --- roles/matrix-awx/tasks/update_variables.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/roles/matrix-awx/tasks/update_variables.yml b/roles/matrix-awx/tasks/update_variables.yml index e072667f7..b281a8c5b 100644 --- a/roles/matrix-awx/tasks/update_variables.yml +++ b/roles/matrix-awx/tasks/update_variables.yml @@ -7,15 +7,21 @@ regexp: 'matrix_synapse_use_presence' replace: 'matrix_synapse_presence_enabled' -- name: Generate matrix_homeserver_generic_secret_key variable +- name: Search for matrix_homeserver_generic_secret_key variable in matrix_vars.yml + delegate_to: 127.0.0.1 + register: presence + shell: "grep -i 'matrix_homeserver_generic_secret_key' /var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/matrix_vars.yml" + no_log: true + +- name: Generate matrix_homeserver_generic_secret_key variable if not present delegate_to: 127.0.0.1 command: | openssl rand -hex 16 register: generic_secret no_log: true - when: ( matrix_homeserver_generic_secret_key is undefined ) or ( matrix_homeserver_generic_secret_key | length == 0 ) + when: presence is not changed -- name: Add new matrix_homeserver_generic_secret_key variable +- name: Add new matrix_homeserver_generic_secret_key variable if not present delegate_to: 127.0.0.1 lineinfile: path: '/var/lib/awx/projects/clients/{{ member_id }}/{{ subscription_id }}/matrix_vars.yml' @@ -23,4 +29,4 @@ insertbefore: '# Basic Settings End' mode: '0600' state: present - when: ( matrix_homeserver_generic_secret_key is undefined ) or ( matrix_homeserver_generic_secret_key | length == 0 ) + when: presence is not changed