runa update

This commit is contained in:
Nico Schottelius 2023-12-04 11:39:28 +01:00
parent b7fc05d561
commit 970afe943d
13 changed files with 179 additions and 7 deletions

View file

@ -12,6 +12,8 @@ runa:
matrix_service: "" matrix_service: ""
turn: turn:
realm: "" realm: ""
nfs:
enabled: false
logs_dirs: logs_dirs:
- name: nginx - name: nginx
@ -28,35 +30,40 @@ runa:
turn: turn:
realm: "turn-1.corp-serv.net" realm: "turn-1.corp-serv.net"
external_ip: "135.125.151.180/10.80.24.41" external_ip: "135.125.151.180/10.80.24.41"
matrix_service: "turn"
mtx-turn-2.ankr.corp-services.app: mtx-turn-2.ankr.corp-services.app:
matrix_service: "turn"
turn: turn:
realm: "turn-2.corp-serv.net" realm: "turn-2.corp-serv.net"
external_ip: "135.125.151.177/10.80.24.42" external_ip: "135.125.151.177/10.80.24.42"
matrix_service: "turn"
lat: lat:
hosts: hosts:
mtx-elem-1.lat.internal.ru.com: mtx-elem-1.lat.internal.ru.com:
matrix_service: "elementweb"
docker_compose: docker_compose:
- elementweb - elementweb
matrix_service: "elementweb"
mtx-elem-2.lat.internal.ru.com: mtx-elem-2.lat.internal.ru.com:
matrix_service: "elementweb"
docker_compose: docker_compose:
- elementweb - elementweb
matrix_service: "elementweb"
mtx-syna-1.lat.internal.ru.com: mtx-syna-1.lat.internal.ru.com:
matrix_service: "synapse" matrix_service: "synapse"
docker_compose: docker_compose:
- synapse - synapse
nfs:
enabled: true
mtx-syna-2.lat.internal.ru.com: mtx-syna-2.lat.internal.ru.com:
matrix_service: "synapse" matrix_service: "synapse"
docker_compose: docker_compose:
- synapse - synapse
nfs:
enabled: true
mtx-mngm-1.lat.internal.ru.com: mtx-mngm-1.lat.internal.ru.com:
matrix_service: "synapse-admin"
has_ssl_certificates: false has_ssl_certificates: false
docker_compose: docker_compose:
- synapse-admin - synapse-admin
mtx-mngm-2.lat.internal.ru.com: mtx-mngm-2.lat.internal.ru.com:
matrix_service: "synapse-admin"
has_ssl_certificates: false has_ssl_certificates: false
docker_compose: docker_compose:
- synapse-admin - synapse-admin

View file

@ -12,7 +12,8 @@
tags: tags:
- synapse - synapse
- logdir - logdir
when: '"synapse" in docker_compose' when: matrix_service == "synapse" or matrix_service == "elementweb" or matrix_service == "turn"
# when: '"synapse" in docker_compose'
- name: SSL Certs - name: SSL Certs
include_role: include_role:
name: ssl-certificates name: ssl-certificates
@ -24,7 +25,7 @@
name: docker-compose name: docker-compose
tags: tags:
- docker - docker
when: docker_compose when: docker_compose or matrix_service
- name: Add elementweb - name: Add elementweb
include_role: include_role:
name: elementweb name: elementweb

View file

@ -4,6 +4,7 @@
path: /mnt path: /mnt
state: mounted state: mounted
fstype: nfs fstype: nfs
when: nfs.enabled == true
- name: Create docker-compose project directories - name: Create docker-compose project directories
ansible.builtin.file: ansible.builtin.file:
path: /mnt/synapse_data path: /mnt/synapse_data

View file

@ -0,0 +1,42 @@
version: 1
formatters:
fmt:
format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s- %(message)s'
filters:
context:
(): synapse.logging.context.LoggingContextFilter
request: ""
handlers:
console:
class: logging.StreamHandler
formatter: fmt
filters: [context]
file:
class: logging.handlers.TimedRotatingFileHandler
formatter: fmt
filename: /logs/worker-federation.log
when: midnight
backupCount: 3
encoding: utf8
root:
level: INFO
handlers:
- console
- file
loggers:
synapse:
level: INFO
synapse.storage.SQL:
level: INFO
ldap3:
level: INFO
ldap_auth_provider:
level: INFO

View file

@ -0,0 +1,42 @@
version: 1
formatters:
fmt:
format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s- %(message)s'
filters:
context:
(): synapse.logging.context.LoggingContextFilter
request: ""
handlers:
console:
class: logging.StreamHandler
formatter: fmt
filters: [context]
file:
class: logging.handlers.TimedRotatingFileHandler
formatter: fmt
filename: /logs/worker-generic.log
when: midnight
backupCount: 3
encoding: utf8
root:
level: INFO
handlers:
- console
- file
loggers:
synapse:
level: INFO
synapse.storage.SQL:
level: INFO
ldap3:
level: INFO
ldap_auth_provider:
level: INFO

View file

@ -0,0 +1,42 @@
version: 1
formatters:
fmt:
format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s- %(message)s'
filters:
context:
(): synapse.logging.context.LoggingContextFilter
request: ""
handlers:
console:
class: logging.StreamHandler
formatter: fmt
filters: [context]
file:
class: logging.handlers.TimedRotatingFileHandler
formatter: fmt
filename: /logs/worker-sync.log
when: midnight
backupCount: 3
encoding: utf8
root:
level: INFO
handlers:
- console
- file
loggers:
synapse:
level: INFO
synapse.storage.SQL:
level: INFO
ldap3:
level: INFO
ldap_auth_provider:
level: INFO

View file

@ -14,10 +14,19 @@ handlers:
class: logging.StreamHandler class: logging.StreamHandler
formatter: fmt formatter: fmt
filters: [context] filters: [context]
file:
class: logging.handlers.TimedRotatingFileHandler
formatter: fmt
filename: /logs/homeserver.log
when: midnight
backupCount: 3
encoding: utf8
root: root:
level: INFO level: INFO
handlers: [console] # to use file handler instead, switch to [file] handlers:
- console
- file
loggers: loggers:
synapse: synapse:

View file

@ -1,6 +1,8 @@
worker_app: synapse.app.generic_worker worker_app: synapse.app.generic_worker
worker_name: synapse-worker-federation worker_name: synapse-worker-federation
worker_log_config: /config/log-worker-federation.yaml
worker_listeners: worker_listeners:
- type: http - type: http
port: 8008 port: 8008

View file

@ -1,6 +1,8 @@
worker_app: synapse.app.generic_worker worker_app: synapse.app.generic_worker
worker_name: synapse-worker-generic worker_name: synapse-worker-generic
worker_log_config: /config/log-worker-generic.yaml
worker_listeners: worker_listeners:
- port: 8008 - port: 8008
type: http type: http

View file

@ -1,6 +1,8 @@
worker_app: synapse.app.generic_worker worker_app: synapse.app.generic_worker
worker_name: synapse-worker-sync worker_name: synapse-worker-sync
worker_log_config: /config/log-worker-sync.yaml
worker_listeners: worker_listeners:
- type: http - type: http
port: 8008 port: 8008

View file

@ -5,6 +5,7 @@ services:
volumes: volumes:
- /mnt/synapse_data:/data - /mnt/synapse_data:/data
- ./config:/config - ./config:/config
- /mnt/logs/synapse:/logs
command: command:
- run - run
- --config-path=/config/homeserver.yaml - --config-path=/config/homeserver.yaml
@ -20,6 +21,7 @@ services:
volumes: volumes:
- /mnt/synapse_data:/data - /mnt/synapse_data:/data
- ./config:/config - ./config:/config
- /mnt/logs/synapse:/logs
environment: environment:
SYNAPSE_WORKER: synapse.app.generic_worker SYNAPSE_WORKER: synapse.app.generic_worker
depends_on: depends_on:
@ -36,6 +38,7 @@ services:
volumes: volumes:
- /mnt/synapse_data:/data - /mnt/synapse_data:/data
- ./config:/config - ./config:/config
- /mnt/logs/synapse:/logs
environment: environment:
SYNAPSE_WORKER: synapse.app.generic_worker SYNAPSE_WORKER: synapse.app.generic_worker
depends_on: depends_on:
@ -52,6 +55,7 @@ services:
volumes: volumes:
- /mnt/synapse_data:/data - /mnt/synapse_data:/data
- ./config:/config - ./config:/config
- /mnt/logs/synapse:/logs
environment: environment:
SYNAPSE_WORKER: synapse.app.generic_worker SYNAPSE_WORKER: synapse.app.generic_worker
depends_on: depends_on:

View file

@ -10,3 +10,4 @@ services:
- ./coturn/cert.pem:/etc/ssl/certs/cert.pem:ro - ./coturn/cert.pem:/etc/ssl/certs/cert.pem:ro
- ./nginx:/etc/nginx/conf.d - ./nginx:/etc/nginx/conf.d
- /ssl:/ssl - /ssl:/ssl
- /mnt/logs/turn:/logs

View file

@ -0,0 +1,17 @@
- name: Copy docker-compose contents
ansible.builtin.copy:
src: files/basedir/
dest: /home/{{ ansible_user }}/docker_compose/{{ matrix_service }}
owner: "{{ ansible_user }}"
mode: '0644'
tags:
- files
- name: Create turn config
ansible.builtin.template:
src: "turnserver.conf"
dest: /home/{{ ansible_user }}/docker_compose/{{ matrix_service }}/turnserver.conf
owner: "{{ ansible_user }}"
mode: '0644'
tags:
- nginx
- synapse