From 83e7a8d9e6173ad1919dd9fa5e8edf602be05459 Mon Sep 17 00:00:00 2001 From: prasket Date: Tue, 21 Jan 2020 18:29:17 -0800 Subject: [PATCH] corrected hardcoded matrix domain and added code to remove old matrix-make-user-admin script per suggestion. --- roles/matrix-postgres/tasks/setup_postgres.yml | 6 ++++++ .../usr-local-bin/matrix-change-user-admin-status.j2 | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/roles/matrix-postgres/tasks/setup_postgres.yml b/roles/matrix-postgres/tasks/setup_postgres.yml index c55a2e65..16c27677 100644 --- a/roles/matrix-postgres/tasks/setup_postgres.yml +++ b/roles/matrix-postgres/tasks/setup_postgres.yml @@ -80,6 +80,12 @@ mode: 0750 when: matrix_postgres_enabled|bool +- name: (Migration) Ensure old matrix-make-user-admin script deleted + file: + path: "/usr/local/bin/matrix-make-user-admin" + state: absent + when: matrix_postgres_enabled|bool + - name: Ensure matrix-postgres-update-user-password-hash script created template: src: "{{ role_path }}/templates/usr-local-bin/matrix-postgres-update-user-password-hash.j2" diff --git a/roles/matrix-postgres/templates/usr-local-bin/matrix-change-user-admin-status.j2 b/roles/matrix-postgres/templates/usr-local-bin/matrix-change-user-admin-status.j2 index 815a5b10..5f66ca6c 100644 --- a/roles/matrix-postgres/templates/usr-local-bin/matrix-change-user-admin-status.j2 +++ b/roles/matrix-postgres/templates/usr-local-bin/matrix-change-user-admin-status.j2 @@ -16,4 +16,4 @@ docker run \ --env-file=/matrix/postgres/env-postgres-psql \ --network matrix \ postgres:12.1-alpine \ - psql -h matrix-postgres -c "UPDATE users set admin=$2 WHERE name like '@$1:seattlematrix.org'" + psql -h matrix-postgres -c "UPDATE users set admin=$2 WHERE name like '@$1:{{ matrix_domain }}'" \ No newline at end of file