From e7b4b3fa56fa48a8a578bec253656d48c2819508 Mon Sep 17 00:00:00 2001 From: PC-Admin Date: Sun, 13 Aug 2023 23:54:32 +0800 Subject: [PATCH] dynamic config for redlight client module --- inventory/host_vars/matrix.duckdomain.xyz/vars.yml | 11 +++++++++++ inventory/hosts | 3 ++- roles/setup-redlight/tasks/setup_redlight.yml | 6 ++++-- roles/setup-synapse/tasks/config_synapse.yml | 14 ++++++-------- 4 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 inventory/host_vars/matrix.duckdomain.xyz/vars.yml diff --git a/inventory/host_vars/matrix.duckdomain.xyz/vars.yml b/inventory/host_vars/matrix.duckdomain.xyz/vars.yml new file mode 100644 index 0000000..bb47a6e --- /dev/null +++ b/inventory/host_vars/matrix.duckdomain.xyz/vars.yml @@ -0,0 +1,11 @@ + +server_name: "duckdomain.xyz" +postgresql_password: "strong-redacted-password" +matrix_admin_email: "perthchat@protonmail.com" +registration_shared_secret: "strong-redacted-password" + +testing_user: { + "username": "newuser2500", + "password": "strong-redacted-password", + "admin": True +} \ No newline at end of file diff --git a/inventory/hosts b/inventory/hosts index 53db2af..117ed96 100644 --- a/inventory/hosts +++ b/inventory/hosts @@ -1,4 +1,5 @@ [matrix_servers] #matrix.penholder.xyz ansible_host=matrix.penholder.xyz ansible_ssh_user=root -matrix.snowsupport.top ansible_host=matrix.snowsupport.top ansible_ssh_user=root \ No newline at end of file +#matrix.snowsupport.top ansible_host=matrix.snowsupport.top ansible_ssh_user=root +matrix.duckdomain.xyz ansible_host=matrix.duckdomain.xyz ansible_ssh_user=root \ No newline at end of file diff --git a/roles/setup-redlight/tasks/setup_redlight.yml b/roles/setup-redlight/tasks/setup_redlight.yml index 6574c56..afaa851 100644 --- a/roles/setup-redlight/tasks/setup_redlight.yml +++ b/roles/setup-redlight/tasks/setup_redlight.yml @@ -26,7 +26,8 @@ name: rsync state: present -- name: Clone redlight module to /tmp +- name: Clone redlight module to /tmp to ansible controller + delegate_to: localhost git: repo: https://code.glowers.club/PC-Admin/redlight.git dest: /tmp/redlight @@ -53,7 +54,8 @@ block: | modules: - module: redlight_client_module.RedlightClientModule - config: {} # No specific configuration for this module + config: + redlight_url: "https://{{ server_name }}/_matrix/loj/v1/abuse_lookup" - module: redlight_server_module.RedlightServerModule config: {} state: present diff --git a/roles/setup-synapse/tasks/config_synapse.yml b/roles/setup-synapse/tasks/config_synapse.yml index 2b2e38c..8c6f279 100644 --- a/roles/setup-synapse/tasks/config_synapse.yml +++ b/roles/setup-synapse/tasks/config_synapse.yml @@ -27,11 +27,9 @@ state: absent notify: Restart Nginx -# - name: Set Synapse Cache Factor -# lineinfile: -# path: /etc/default/matrix-synapse -# regexp: '^SYNAPSE_CACHE_FACTOR=' -# line: 'SYNAPSE_CACHE_FACTOR=2.0' -# state: present -# create: yes -# notify: Restart Synapse +- name: Ensure Synapse is running + service: + name: matrix-synapse + state: started + enabled: yes + notify: Restart Synapse \ No newline at end of file