From 466142c446023e0d63b4be8afdbdc865b520374d Mon Sep 17 00:00:00 2001 From: PC-Admin Date: Wed, 23 Aug 2023 23:48:42 +0800 Subject: [PATCH] add database for redlight server --- roles/setup-redlight/tasks/setup_redlight.yml | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/roles/setup-redlight/tasks/setup_redlight.yml b/roles/setup-redlight/tasks/setup_redlight.yml index f33edc1..68ea4de 100644 --- a/roles/setup-redlight/tasks/setup_redlight.yml +++ b/roles/setup-redlight/tasks/setup_redlight.yml @@ -66,9 +66,29 @@ redlight_git_token: "{{ redlight_git_token }}" redlight_source_list_file_path: "dist/summaries.json" redlight_client_tokens: "{{ redlight_client_tokens }}" - redlight_filtered_tags: "{{ redlight_filtered_tags }}" + redlight_filtered_tags: {{ redlight_filtered_tags }} state: present owner: root group: root mode: '0644' notify: Restart Synapse + +- name: Create matrix_redlight role in PostgreSQL + become: yes + become_user: postgres + postgresql_user: + name: matrix_redlight + password: "{{ redlight_postgresql_password }}" + role_attr_flags: NOSUPERUSER,NOCREATEDB,NOCREATEROLE + encrypted: yes + +- name: Create Database for matrix_redlight + become: yes + become_user: postgres + postgresql_db: + name: matrix_redlight + encoding: UTF8 + lc_collate: C + lc_ctype: C + template: template0 + owner: matrix_redlight