From 44b3b99990f4decbd9c7025e6545fa631f9835a4 Mon Sep 17 00:00:00 2001 From: Salt Date: Tue, 23 Jun 2020 09:47:48 -0500 Subject: [PATCH] Template out matrix vars a bit more nicely, make config changes --- inventory/group_vars/9iron.yml | 6 ++++++ roles/matrix/defaults/main.yml | 4 ++++ roles/matrix/templates/homeserver.yaml | 4 ++-- roles/matrix/templates/server_name.yaml | 10 ++-------- roles/matrix/templates/shared_secrets.yaml | 3 ++- webservers.yml | 5 ----- 6 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 roles/matrix/defaults/main.yml diff --git a/inventory/group_vars/9iron.yml b/inventory/group_vars/9iron.yml index 2e05c7c..2b6b8b1 100644 --- a/inventory/group_vars/9iron.yml +++ b/inventory/group_vars/9iron.yml @@ -62,6 +62,12 @@ grafana_mysql_password: !vault | grafana_url: "monitor.9iron.club" grafana_webroot: "/var/www/grafana" +# Matrix +matrix_server_name: "9iron.club" +matrix_url: "matrix.9iron.club" +matrix_webroot: "/var/www/riot" +matrix_enable_registration: "true" + # Nextcloud nextcloud_mysql_password: !vault | $ANSIBLE_VAULT;1.1;AES256 diff --git a/roles/matrix/defaults/main.yml b/roles/matrix/defaults/main.yml new file mode 100644 index 0000000..dfb75d2 --- /dev/null +++ b/roles/matrix/defaults/main.yml @@ -0,0 +1,4 @@ +# vim:ft=ansible: +matrix_admin_contact: "mailto:rehashedsalt@cock.li" +matrix_disabled_message: "Matrix on this server is down for maintenance" +matrix_enable_registration: "false" diff --git a/roles/matrix/templates/homeserver.yaml b/roles/matrix/templates/homeserver.yaml index b7217af..54c2d7d 100644 --- a/roles/matrix/templates/homeserver.yaml +++ b/roles/matrix/templates/homeserver.yaml @@ -31,9 +31,9 @@ listeners: compress: false ## Homeserver blocking ## -admin_contact: 'mailto:rehashedsalt@cock.li' +admin_contact: '{{ matrix_admin_contact }}' #hs_disabled: false -#hs_disabled_message: 'Matrix on this server is down for maintenance' +#hs_disabled_message: '{{ matrix_disabled_message }}' retention: enabled: true default_policy: diff --git a/roles/matrix/templates/server_name.yaml b/roles/matrix/templates/server_name.yaml index f33ebd4..3eed734 100644 --- a/roles/matrix/templates/server_name.yaml +++ b/roles/matrix/templates/server_name.yaml @@ -1,9 +1,3 @@ -# This file is autogenerated, and will be recreated on upgrade if it is deleted. -# Any changes you make will be preserved. - -# The domain name of the server, with optional explicit port. -# This is used by remote servers to connect to this server, -# e.g. matrix.org, localhost:8080, etc. -# This is also the last part of your UserID. -# +# This file is managed via Ansible; any changes here will be overwritten +# And rightfully so. Don't screw with this server_name: {{ matrix_server_name }} diff --git a/roles/matrix/templates/shared_secrets.yaml b/roles/matrix/templates/shared_secrets.yaml index e0e986e..68e0b3f 100644 --- a/roles/matrix/templates/shared_secrets.yaml +++ b/roles/matrix/templates/shared_secrets.yaml @@ -1,3 +1,4 @@ -# This file contains shared secrets so you can leave them out of homeserver.yaml +# This file is managed via Ansible; any changes here will be overwritten +# And rightfully so. Don't screw with this registration_shared_secret: {{ matrix_reg_secret.stdout }} turn_shared_secret: {{ matrix_turn_secret.stdout }} diff --git a/webservers.yml b/webservers.yml index 842bb8f..5ca1517 100644 --- a/webservers.yml +++ b/webservers.yml @@ -9,11 +9,6 @@ - role: backups tags: [ backups ] - role: matrix - vars: - matrix_server_name: "9iron.club" - matrix_url: "matrix.9iron.club" - matrix_webroot: "/var/www/riot" - matrix_enable_registration: "true" tags: [ fedi, matrix ] - hosts: web1 roles: