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