|
|
@ -23,30 +23,22 @@ |
|
|
|
- postgresql-devel |
|
|
|
- postgresql-devel |
|
|
|
- libpqxx-devel |
|
|
|
- libpqxx-devel |
|
|
|
- jemalloc |
|
|
|
- jemalloc |
|
|
|
- rh-python36-python-virtualenv |
|
|
|
- python3-virtualenv |
|
|
|
- rh-python36-python-pip |
|
|
|
- python3-pip |
|
|
|
|
|
|
|
- python-psycopg2 |
|
|
|
tags: matrix |
|
|
|
tags: matrix |
|
|
|
|
|
|
|
|
|
|
|
- name: Stop synapse |
|
|
|
- name: Wipe pip cache |
|
|
|
service: name=matrix-synapse state=stopped |
|
|
|
file: path=/root/.cache/pip state=absent |
|
|
|
when: synapse_venv_27.stat.exists |
|
|
|
when: synapse_old_venv.stat.exists |
|
|
|
tags: matrix |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Remove the venv |
|
|
|
|
|
|
|
file: path={{ synapse_root_dir }}/{{ item }} state=absent |
|
|
|
|
|
|
|
loop: |
|
|
|
|
|
|
|
- lib |
|
|
|
|
|
|
|
- lib64 |
|
|
|
|
|
|
|
- include |
|
|
|
|
|
|
|
- bin |
|
|
|
|
|
|
|
when: synapse_venv_27.stat.exists |
|
|
|
|
|
|
|
tags: matrix |
|
|
|
tags: matrix |
|
|
|
|
|
|
|
|
|
|
|
- name: Install or update dependencies in the virtual env |
|
|
|
- name: Install or update dependencies in the virtual env |
|
|
|
pip: |
|
|
|
pip: |
|
|
|
state: latest |
|
|
|
state: latest |
|
|
|
virtualenv: "{{ synapse_root_dir }}" |
|
|
|
virtualenv: "{{ synapse_root_dir }}/venv" |
|
|
|
virtualenv_command: /opt/rh/rh-python36/root/usr/bin/virtualenv |
|
|
|
virtualenv_command: /usr/bin/virtualenv-3 |
|
|
|
|
|
|
|
virtualenv_python: /usr/bin/python3 |
|
|
|
name: |
|
|
|
name: |
|
|
|
- bleach |
|
|
|
- bleach |
|
|
|
- matrix-synapse-ldap3 |
|
|
|
- matrix-synapse-ldap3 |
|
|
@ -62,8 +54,9 @@ |
|
|
|
|
|
|
|
|
|
|
|
- name: Install or update synapse in a virtualenv |
|
|
|
- name: Install or update synapse in a virtualenv |
|
|
|
pip: |
|
|
|
pip: |
|
|
|
virtualenv: "{{ synapse_root_dir }}" |
|
|
|
virtualenv: "{{ synapse_root_dir }}/venv" |
|
|
|
virtualenv_command: /opt/rh/rh-python36/root/usr/bin/virtualenv |
|
|
|
virtualenv_command: /usr/bin/virtualenv-3 |
|
|
|
|
|
|
|
virtualenv_python: /usr/bin/python3 |
|
|
|
name: |
|
|
|
name: |
|
|
|
- matrix-synapse |
|
|
|
- matrix-synapse |
|
|
|
version: "{{ synapse_version }}" |
|
|
|
version: "{{ synapse_version }}" |
|
|
@ -73,6 +66,7 @@ |
|
|
|
- name: Install the service unit file |
|
|
|
- name: Install the service unit file |
|
|
|
template: src=matrix-synapse.service.j2 dest=/etc/systemd/system/matrix-synapse.service |
|
|
|
template: src=matrix-synapse.service.j2 dest=/etc/systemd/system/matrix-synapse.service |
|
|
|
register: synapse_service_unit |
|
|
|
register: synapse_service_unit |
|
|
|
|
|
|
|
notify: restart synapse |
|
|
|
tags: matrix |
|
|
|
tags: matrix |
|
|
|
|
|
|
|
|
|
|
|
- name: Reload systemd |
|
|
|
- name: Reload systemd |
|
|
@ -83,7 +77,7 @@ |
|
|
|
- name: Install REST auth module |
|
|
|
- name: Install REST auth module |
|
|
|
get_url: |
|
|
|
get_url: |
|
|
|
url: https://raw.githubusercontent.com/ma1uta/matrix-synapse-rest-password-provider/master/rest_auth_provider.py |
|
|
|
url: https://raw.githubusercontent.com/ma1uta/matrix-synapse-rest-password-provider/master/rest_auth_provider.py |
|
|
|
dest: "{{ synapse_root_dir }}/lib/python3.6/site-packages/" |
|
|
|
dest: "{{ synapse_root_dir }}/venv/lib/python3.6/site-packages/" |
|
|
|
tags: matrix |
|
|
|
tags: matrix |
|
|
|
|
|
|
|
|
|
|
|
- name: Create the PostgreSQL role |
|
|
|
- name: Create the PostgreSQL role |
|
|
@ -110,12 +104,10 @@ |
|
|
|
tags: matrix |
|
|
|
tags: matrix |
|
|
|
|
|
|
|
|
|
|
|
- name: Deploy backup scripts |
|
|
|
- name: Deploy backup scripts |
|
|
|
template: src={{ item.src }} dest=/etc/backup/{{ item.dest }}/matrix_synapse.sh mode=750 |
|
|
|
template: src={{ item }}-backup.sh.j2 dest=/etc/backup/{{ item }}.d/matrix_synapse.sh mode=750 |
|
|
|
with_items: |
|
|
|
loop: |
|
|
|
- src: pre-backup.sh.j2 |
|
|
|
- pre |
|
|
|
dest: pre.d |
|
|
|
- post |
|
|
|
- src: post-backup.sh.j2 |
|
|
|
|
|
|
|
dest: post.d |
|
|
|
|
|
|
|
tags: matrix |
|
|
|
tags: matrix |
|
|
|
|
|
|
|
|
|
|
|
- name: Install synapse_janitor.sql script |
|
|
|
- name: Install synapse_janitor.sql script |
|
|
@ -125,7 +117,7 @@ |
|
|
|
tags: matrix |
|
|
|
tags: matrix |
|
|
|
|
|
|
|
|
|
|
|
- name: Deploy janitor script |
|
|
|
- name: Deploy janitor script |
|
|
|
template: src=synapse_janitor.sh.j2 dest={{ synapse_root_dir }}/bin/synapse_janitor.sh mode=700 |
|
|
|
template: src=synapse_janitor.sh.j2 dest={{ synapse_root_dir }}/venv/bin/synapse_janitor.sh mode=700 |
|
|
|
tags: matrix |
|
|
|
tags: matrix |
|
|
|
|
|
|
|
|
|
|
|
- name: Setup cron job to clean synapse database |
|
|
|
- name: Setup cron job to clean synapse database |
|
|
@ -133,7 +125,7 @@ |
|
|
|
name: matrix_synapse_janitor |
|
|
|
name: matrix_synapse_janitor |
|
|
|
special_time: weekly |
|
|
|
special_time: weekly |
|
|
|
user: root |
|
|
|
user: root |
|
|
|
job: '{{ synapse_root_dir }}/bin/synapse_janitor.sh | /bin/systemd-cat' |
|
|
|
job: '{{ synapse_root_dir }}/venv/bin/synapse_janitor.sh | /bin/systemd-cat' |
|
|
|
cron_file: matrix_synapse |
|
|
|
cron_file: matrix_synapse |
|
|
|
tags: matrix |
|
|
|
tags: matrix |
|
|
|
|
|
|
|
|
|
|
|