diff --git a/ansible/inventory/runa.yml b/ansible/inventory/runa.yml index c4d54d2..5e92b4d 100644 --- a/ansible/inventory/runa.yml +++ b/ansible/inventory/runa.yml @@ -21,6 +21,11 @@ runa: uid: 991 - name: turn uid: 65534 + matrix: + homeserver: "" + elementweb: "" + matrixdomain: "" + logout_redirect_url: "" children: ank: hosts: @@ -35,6 +40,12 @@ runa: realm: "turn-2.corp-serv.net" external_ip: "135.125.151.177/10.80.24.42" lat: + vars: + matrix: + homeserver: "synapse.corp-apps.com" + elementweb: "element.corp-serv.net" + matrixdomain: "corp-serv.net" + logout_redirect_url: "https://idp.corp-serv.net/realms/MAT/protocol/openid-connect/logout" hosts: mtx-elem-1.lat.internal.ru.com: matrix_service: "elementweb" @@ -57,6 +68,12 @@ runa: mtx-mngm-2.lat.internal.ru.com: matrix_service: "synapse-admin" lta: + vars: + matrix: + homeserver: "synapse.lta.corp-apps.com" + elementweb: "element.lta.corp-serv.net" + matrixdomain: "lta.corp-serv.net" + logout_redirect_url: "FIXME" hosts: mtx-mngm-1.lta.internal.ru.com: matrix_service: "synapse-admin" diff --git a/ansible/roles/elementweb/tasks/main.yml b/ansible/roles/elementweb/tasks/main.yml index e04c0f3..a5932c8 100644 --- a/ansible/roles/elementweb/tasks/main.yml +++ b/ansible/roles/elementweb/tasks/main.yml @@ -26,3 +26,12 @@ mode: '0644' tags: - test + +- name: Create elementweb config + ansible.builtin.template: + src: "elementweb/config.json" + dest: /home/{{ ansible_user }}/docker_compose/{{ matrix_service }}/config.json + owner: "{{ ansible_user }}" + mode: '0644' + tags: + - test diff --git a/ansible/roles/elementweb/files/basedir/config.json b/ansible/roles/elementweb/templates/elementweb/config.json similarity index 88% rename from ansible/roles/elementweb/files/basedir/config.json rename to ansible/roles/elementweb/templates/elementweb/config.json index f60d176..124ef4e 100755 --- a/ansible/roles/elementweb/files/basedir/config.json +++ b/ansible/roles/elementweb/templates/elementweb/config.json @@ -1,8 +1,8 @@ { "default_server_config": { "m.homeserver": { - "base_url": "https://synapse.corp-apps.com", - "server_name": "corp-serv.net" + "base_url": "https://{{ matrix.homeserver }}", + "server_name": "{{ matrix.matrixdomain }}" }, "m.identity_server": { "base_url": "https://vector.im" @@ -45,7 +45,7 @@ "participant_limit": 8, "brand": "Element Call" }, - "logout_redirect_url": "https://idp.corp-serv.net/realms/MAT/protocol/openid-connect/logout", + "logout_redirect_url": "{{ matrix.logout_redirect_url }}", "sso_redirect_options": { "immediate": true }, diff --git a/ansible/roles/synapse/templates/synapse/homeserver.yaml b/ansible/roles/synapse/templates/synapse/homeserver.yaml index a85b9a8..d7dc9f2 100755 --- a/ansible/roles/synapse/templates/synapse/homeserver.yaml +++ b/ansible/roles/synapse/templates/synapse/homeserver.yaml @@ -26,7 +26,7 @@ # lowercase and may contain an explicit port. # Examples: matrix.org, localhost:8080 # -server_name: "corp-serv.net" +server_name: "{{ matrix.matrixdomain }}" # When running as a daemon, the file to store the pid in # @@ -40,7 +40,7 @@ pid_file: /homeserver.pid # under the 'listeners' configuration, however this is a security risk: # https://github.com/matrix-org/synapse#security-note # -web_client_location: https://element.corp-serv.net +web_client_location: https://{{ matrix.elementweb }} # The public-facing base URL that clients use to access this Homeserver (not # including _matrix/...). This is the same URL a user might enter into the @@ -49,7 +49,7 @@ web_client_location: https://element.corp-serv.net # Otherwise, it should be the URL to reach Synapse's client HTTP listener (see # 'listeners' below). # -public_baseurl: https://synapse.corp-apps.com +public_baseurl: https://{{ matrix.homeserver }} # 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