Update 2 files
- /roles/matrix/files/homeserver.yaml - /roles/matrix/tasks/main.yml
This commit is contained in:
parent
fcc90856ae
commit
300fc1d40f
@ -1,6 +1,7 @@
|
||||
server_name: "{{ matrix_server_name }}"
|
||||
pid_file: /data/homeserver.pid
|
||||
public_baseurl: "https://{{ matrix_domain }}/"
|
||||
|
||||
listeners:
|
||||
- port: 8008
|
||||
tls: false
|
||||
@ -23,13 +24,13 @@ database:
|
||||
log_config: "/data/log.config"
|
||||
media_store_path: /data/media_store
|
||||
uploads_path: /data/uploads
|
||||
enable_registration: {{ matrix_registration_enabled }}
|
||||
enable_registration: {{ matrix_registration_enabled | bool | lower }}
|
||||
enable_registration_without_verification: false
|
||||
registration_shared_secret: "{{ matrix_synapse_secret }}"
|
||||
macaroon_secret_key: "{{ matrix_macaroon_secret }}"
|
||||
form_secret: "{{ matrix_form_secret }}"
|
||||
|
||||
report_stats: {{ "true" if matrix_report_stats else "false" }}
|
||||
report_stats: {{ matrix_report_stats | bool | lower }}
|
||||
|
||||
retention:
|
||||
enabled: true
|
||||
|
||||
@ -14,21 +14,20 @@
|
||||
- "{{ matrix_postgres_dir }}"
|
||||
|
||||
- name: Generate Synapse configuration
|
||||
docker_container:
|
||||
name: matrix-config-generator
|
||||
image: matrixdotorg/synapse:latest
|
||||
command: |
|
||||
python -m synapse.app.homeserver \
|
||||
--server-name {{ matrix_server_name }} \
|
||||
--config-path /data/homeserver.yaml \
|
||||
--generate-config \
|
||||
--report-stats={{ "yes" if matrix_report_stats else "no" }}
|
||||
volumes:
|
||||
- "{{ matrix_config_dir }}:/data"
|
||||
auto_remove: true
|
||||
command: >
|
||||
docker run --rm
|
||||
-v {{ matrix_config_dir }}:/data
|
||||
matrixdotorg/synapse:latest
|
||||
python -m synapse.app.homeserver
|
||||
--server-name {{ matrix_server_name }}
|
||||
--config-path /data/homeserver.yaml
|
||||
--generate-config
|
||||
--report-stats={{ "yes" if matrix_report_stats else "no" }}
|
||||
args:
|
||||
creates: "{{ matrix_config_dir }}/homeserver.yaml"
|
||||
|
||||
- name: Copy custom configuration files
|
||||
copy:
|
||||
template:
|
||||
src: "{{ item }}"
|
||||
dest: "{{ matrix_config_dir }}/"
|
||||
mode: 0644
|
||||
@ -45,6 +44,7 @@
|
||||
loop:
|
||||
- "homeserver.yaml"
|
||||
- "log.config"
|
||||
- "homeserver.yaml.generated" # если файл существует
|
||||
|
||||
- name: Deploy Matrix docker-compose.yml
|
||||
template:
|
||||
@ -59,6 +59,13 @@
|
||||
args:
|
||||
executable: /bin/bash
|
||||
|
||||
- name: Wait for database to be ready
|
||||
wait_for:
|
||||
host: localhost
|
||||
port: "{{ matrix_port }}"
|
||||
timeout: 60
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Wait for services to start
|
||||
pause:
|
||||
seconds: 30
|
||||
@ -80,6 +87,7 @@
|
||||
docker exec matrix-synapse register_new_matrix_user http://localhost:8008 -c /data/homeserver.yaml -u admin -p {{ vault_matrix_admin_password }} --admin
|
||||
when: matrix_admin_user != "" and matrix_registration_enabled
|
||||
ignore_errors: true
|
||||
become: no
|
||||
|
||||
- name: Show connection info
|
||||
debug:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user