mirror of
https://github.com/famedly/ansible-collection-matrix
synced 2024-12-15 05:32:26 +00:00
47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
---
|
|
- hosts: all
|
|
become: true
|
|
vars:
|
|
dbname: synapse
|
|
dbuser: synapse_user
|
|
dbpw: synapse_password
|
|
tasks:
|
|
- name: Flush handlers
|
|
meta: flush_handlers
|
|
|
|
- name: Check if the api returns the correct version
|
|
uri:
|
|
url: "http://localhost:8008/_matrix/federation/v1/version"
|
|
return_content: true
|
|
register: api_version
|
|
until: api_version.status == 200
|
|
retries: 10
|
|
delay: 2
|
|
|
|
- name: Check returned api version
|
|
fail:
|
|
msg: "Return value {{ api_version }} is not as expected {{ matrix_synapse_version }}"
|
|
when: matrix_synapse_version != "v"~(api_version.content | from_json).server.version
|
|
roles:
|
|
- role: geerlingguy.pip
|
|
pip_package: python3-pip
|
|
pip_install_packages:
|
|
- name: psycopg2-binary
|
|
- role: geerlingguy.postgresql
|
|
postgresql_databases:
|
|
- name: "{{ dbname }}"
|
|
postgresql_users:
|
|
- name: "{{ dbuser }}"
|
|
password: "{{ dbpw }}"
|
|
postgresql_global_config_options:
|
|
- option: listen_addresses
|
|
value: "*"
|
|
- role: synapse
|
|
matrix_server_name: localhost
|
|
matrix_synapse_report_stats: false
|
|
matrix_synapse_pg_host: localhost
|
|
matrix_synapse_pg_user: "{{ dbuser }}"
|
|
matrix_synapse_pg_pass: "{{ dbpw }}"
|
|
matrix_synapse_pg_db: "{{ dbname }}"
|
|
matrix_synapse_extra_config:
|
|
no_tls: true
|