From 3468d69e8997965d497d9c2664e71f7ad6b309db Mon Sep 17 00:00:00 2001
From: Christian Elberfeld <christian.elberfeld@adesso.de>
Date: Sat, 1 Jun 2019 16:00:36 +0200
Subject: [PATCH] matrix settings ausgelagert

---
 group_vars/prod                                        |  6 ++++++
 webserver/docker_matrix/tasks/main.yml                 |  1 -
 .../templates/synapse-data/homeserver.yaml             | 10 +++++-----
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/group_vars/prod b/group_vars/prod
index 156d26d4..e60bae0d 100644
--- a/group_vars/prod
+++ b/group_vars/prod
@@ -38,3 +38,9 @@ influxdb_snmp:
   db: "influx"
   user: "influx" 
   password: "influx" 
+
+# Matrix Settings 
+matrix:
+  domain: matrix.warpzone.ms
+  public_url: https://matrix.warpzone.ms
+  identity_server: https://matrix.warpzone.ms
diff --git a/webserver/docker_matrix/tasks/main.yml b/webserver/docker_matrix/tasks/main.yml
index 70502e86..8982c824 100644
--- a/webserver/docker_matrix/tasks/main.yml
+++ b/webserver/docker_matrix/tasks/main.yml
@@ -21,7 +21,6 @@
     - "/srv/matrix/synapse-data/"
 
 
-
 - name: Konfig-Dateien erstellen 
   template: src={{ item }} dest=/srv/matrix/{{ item }}
   with_items: 
diff --git a/webserver/docker_matrix/templates/synapse-data/homeserver.yaml b/webserver/docker_matrix/templates/synapse-data/homeserver.yaml
index ab533406..f27d76ae 100644
--- a/webserver/docker_matrix/templates/synapse-data/homeserver.yaml
+++ b/webserver/docker_matrix/templates/synapse-data/homeserver.yaml
@@ -17,7 +17,7 @@
 # e.g. matrix.org, localhost:8080, etc.
 # This is also the last part of your UserID.
 #
-server_name: "matrix.warpzone.ms"
+server_name: "{{ matrix.domain }}"
 
 # When running as a daemon, the file to store the pid in
 #
@@ -57,7 +57,7 @@ pid_file: /tmp/homeserver.pid
 # use synapse with a reverse proxy, this should be the URL to reach
 # synapse via the proxy.
 #
-public_baseurl: https://matrix.warpzone.ms/
+public_baseurl: {{ matrix.public_url }}/
 
 # Set the soft limit on the number of file descriptors synapse can use
 # Zero is used to indicate synapse should set the soft limit to the
@@ -634,7 +634,7 @@ enable_registration: false
 # This setting is ignored unless public_baseurl is also set.)
 #
 #default_identity_server: https://matrix.org
-default_identity_server: https://matrix.warpzone.ms
+default_identity_server: {{ matrix.identity_server }}
 
 # The list of identity servers trusted to verify third party
 # identifiers by this server.
@@ -646,13 +646,13 @@ default_identity_server: https://matrix.warpzone.ms
 #  - matrix.org
 #  - vector.im
 trusted_third_party_id_servers:
-  - matrix.warpzone.ms
+  - {{ matrix.domain }}
   
 # Users who register on this homeserver will automatically be joined
 # to these rooms
 #
 auto_join_rooms:
-  - "#warpzone:matrix.warpzone.ms"
+  - "#warpzone:{{ matrix.domain }}"
 
 # Where auto_join_rooms are specified, setting this flag ensures that the
 # the rooms exist by creating them when the first user on the
-- 
GitLab