ansible-collection-famedly-.../tasks/deployment.yml

78 lines
2.5 KiB
YAML

---
- name: install synapse with pip into virtualenv
block:
- name: Install dependencies
apt:
name:
- build-essential
- "python{{ (matrix_synapse_python_version == '2') | ternary('2.7', '3') }}-dev"
- libffi-dev
- python-pip
- python-setuptools
- sqlite3
- libssl-dev
- python-virtualenv
- libjpeg-dev
- libxslt1-dev
- git
- libpq-dev
state: present
cache_valid_time: 1800
tags:
- pre_install
- name: Create virtualenv
pip:
name:
- pip
- setuptools
- lxml
- psycopg2-binary
- mock
virtualenv: "{{ matrix_synapse_base_path }}/env"
virtualenv_python: "python{{ matrix_synapse_python_version }}"
extra_args: --upgrade
tags:
- pre_install
- name: Clone synapse
git:
repo: https://github.com/matrix-org/synapse
dest: "{{ matrix_synapse_base_path }}/synapse"
accept_hostkey: yes
version: "{{ matrix_synapse_version }}"
register: clone_synapse
tags:
- pre_install
- name: Install Synapse
pip:
name: "{{ matrix_synapse_base_path }}/synapse"
virtualenv: "{{ matrix_synapse_base_path }}/env"
virtualenv_python: "python{{ matrix_synapse_python_version }}"
when: clone_synapse.changed
tags:
- skip_ansible_lint # skip when clause
- pre_install
when: matrix_synapse_deployment_method == "pip"
- name: install synapse with docker
docker_container:
name: synapse
image: "docker.io/matrixdotorg/synapse:{{ matrix_synapse_version }}-py{{ matrix_synapse_python_version }}"
ports: "{{ matrix_synapse_docker_ports }}"
labels: "{{ matrix_synapse_docker_labels }}"
restart_policy: unless-stopped
entrypoint: "python"
command:
- "-m"
- "synapse.app.homeserver"
- "-c"
- "{{ matrix_synapse_base_path }}/homeserver.yaml"
user: "{{ synapse_user.uid }}:{{ synapse_user.group }}"
volumes:
- "{{ matrix_synapse_config.media_store_path }}:{{ matrix_synapse_config.media_store_path }}"
- "{{ matrix_synapse_config.uploads_path }}:{{ matrix_synapse_config.uploads_path }}"
- "{{ matrix_synapse_base_path }}/homeserver.yaml:{{ matrix_synapse_base_path }}/homeserver.yaml"
- "{{ matrix_synapse_base_path }}/tls:{{ matrix_synapse_base_path }}/tls"
when: matrix_synapse_deployment_method == "docker"