2018-07-30 14:56:33 +00:00
|
|
|
---
|
2019-02-16 10:25:57 +00:00
|
|
|
- name: install synapse with pip into virtualenv
|
|
|
|
block:
|
|
|
|
- name: Install dependencies
|
|
|
|
apt:
|
|
|
|
name:
|
2019-07-27 10:46:46 +00:00
|
|
|
- git
|
2019-02-16 10:25:57 +00:00
|
|
|
- build-essential
|
2019-07-27 10:46:46 +00:00
|
|
|
- python3-dev
|
|
|
|
- python-virtualenv
|
2019-02-16 10:25:57 +00:00
|
|
|
- python-pip
|
|
|
|
- python-setuptools
|
|
|
|
- sqlite3
|
2019-07-27 10:46:46 +00:00
|
|
|
- libffi-dev
|
2019-02-16 10:25:57 +00:00
|
|
|
- libssl-dev
|
|
|
|
- libjpeg-dev
|
|
|
|
- libxslt1-dev
|
|
|
|
- libpq-dev
|
|
|
|
state: present
|
|
|
|
cache_valid_time: 1800
|
|
|
|
tags:
|
|
|
|
- pre_install
|
2018-07-30 14:56:33 +00:00
|
|
|
|
2019-02-16 10:25:57 +00:00
|
|
|
- name: Create virtualenv
|
|
|
|
pip:
|
|
|
|
name:
|
|
|
|
- pip
|
|
|
|
- setuptools
|
2019-02-21 22:17:57 +00:00
|
|
|
virtualenv: "{{ matrix_synapse_base_path }}/env"
|
2019-07-27 10:46:46 +00:00
|
|
|
virtualenv_python: python3
|
2019-02-16 10:25:57 +00:00
|
|
|
extra_args: --upgrade
|
|
|
|
tags:
|
|
|
|
- pre_install
|
2018-07-30 14:56:33 +00:00
|
|
|
|
2019-02-16 10:25:57 +00:00
|
|
|
- name: Clone synapse
|
|
|
|
git:
|
|
|
|
repo: https://github.com/matrix-org/synapse
|
2019-02-21 22:17:57 +00:00
|
|
|
dest: "{{ matrix_synapse_base_path }}/synapse"
|
2019-02-16 10:25:57 +00:00
|
|
|
accept_hostkey: yes
|
2020-09-19 09:44:30 +00:00
|
|
|
version: "v{{ matrix_synapse_version }}"
|
2019-02-16 10:25:57 +00:00
|
|
|
register: clone_synapse
|
|
|
|
tags:
|
|
|
|
- pre_install
|
2018-07-30 14:56:33 +00:00
|
|
|
|
2019-02-16 10:25:57 +00:00
|
|
|
- name: Install Synapse
|
|
|
|
pip:
|
2019-07-27 10:46:46 +00:00
|
|
|
name: "{{ matrix_synapse_base_path }}/synapse[matrix-synapse-ldap3,postgres,resources.consent,acme,url_preview]"
|
2019-02-21 22:17:57 +00:00
|
|
|
virtualenv: "{{ matrix_synapse_base_path }}/env"
|
2019-02-16 10:25:57 +00:00
|
|
|
when: clone_synapse.changed
|
|
|
|
tags:
|
|
|
|
- skip_ansible_lint # skip when clause
|
|
|
|
- pre_install
|
2019-04-08 22:30:30 +00:00
|
|
|
notify: restart matrix-synapse
|
2019-02-16 10:25:57 +00:00
|
|
|
when: matrix_synapse_deployment_method == "pip"
|
2018-08-17 13:40:32 +00:00
|
|
|
|
2019-02-16 10:25:57 +00:00
|
|
|
- name: install synapse with docker
|
|
|
|
docker_container:
|
2020-05-27 16:35:20 +00:00
|
|
|
name: "{{ matrix_synapse_container_name }}"
|
2020-09-19 09:44:30 +00:00
|
|
|
image: "{{ matrix_synapse_container_ref }}:{{ matrix_synapse_container_tag }}"
|
2019-02-16 10:25:57 +00:00
|
|
|
ports: "{{ matrix_synapse_docker_ports }}"
|
2020-06-22 18:35:26 +00:00
|
|
|
labels: "{{ matrix_synapse_docker_labels_complete }}"
|
2019-02-16 10:25:57 +00:00
|
|
|
restart_policy: unless-stopped
|
2019-06-11 21:42:37 +00:00
|
|
|
recreate: true
|
|
|
|
pull: true
|
2019-02-16 10:25:57 +00:00
|
|
|
entrypoint: "python"
|
|
|
|
command:
|
|
|
|
- "-m"
|
|
|
|
- "synapse.app.homeserver"
|
|
|
|
- "-c"
|
2019-02-21 22:17:57 +00:00
|
|
|
- "{{ matrix_synapse_base_path }}/homeserver.yaml"
|
2019-02-16 10:25:57 +00:00
|
|
|
user: "{{ synapse_user.uid }}:{{ synapse_user.group }}"
|
2019-12-09 13:47:21 +00:00
|
|
|
volumes: "{{ matrix_synapse_docker_volumes }}"
|
2019-02-16 10:25:57 +00:00
|
|
|
when: matrix_synapse_deployment_method == "docker"
|