]> git.ekhem.eu.org Git - turnup.git/commitdiff
Add a script for configuring matrix.
authorJakub Czajka <jakub@ekhem.eu.org>
Wed, 27 Sep 2023 20:51:10 +0000 (22:51 +0200)
committerJakub Czajka <jczajka@google.com>
Sun, 24 Dec 2023 18:46:45 +0000 (19:46 +0100)
server/matrix.yaml [new file with mode: 0644]

diff --git a/server/matrix.yaml b/server/matrix.yaml
new file mode 100644 (file)
index 0000000..aabba06
--- /dev/null
@@ -0,0 +1,42 @@
+# Copyright (c) 2023 Jakub Czajka <jakub@ekhem.eu.org>
+# License: GPL-3.0 or later.
+
+- name: Checkout configuration files
+  command: |
+    git --work-tree=/tmp --git-dir=/srv/git/server.git checkout main --force \
+      matrix/*
+  become: yes
+- name: Install matrix
+  package:
+    name:
+      - matrix-synapse
+    state: latest
+  become: yes
+- name: Ensure matrix directory structure exists
+  file:
+    path: "/etc/matrix-synapse/conf.d"
+    state: directory
+  become: yes
+- name: Copy to /etc/matrix-synapse
+  copy:
+    src: "/tmp/matrix/{{ item }}"
+    dest: "/etc/matrix-synapse"
+    remote_src: true
+  become: true
+  with_items:
+    - homeserver.yaml
+    - log.yaml
+- name: Copy to /etc/matrix-synapse/conf.d
+  copy:
+    src: "/tmp/matrix/{{ item }}"
+    dest: "/etc/matrix-synapse/conf.d"
+    remote_src: true
+  become: true
+  with_items:
+    - report_stats.yaml
+    - server_name.yaml
+- name: Restart matrix
+  service:
+    name: matrix-synapse
+    state: restarted
+  become: yes