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

78 lines
1.4 KiB
YAML
Raw Normal View History

2018-07-30 14:56:33 +00:00
---
- name: create user
user:
name: synapse
state: present
tags:
- pre_install
2018-07-30 14:56:33 +00:00
- name: create directory
file:
name: /opt/synapse
state: directory
owner: synapse
group: synapse
tags:
- pre_install
2018-07-30 14:56:33 +00:00
- name: Install dependencies
apt:
name: "{{ item }}"
state: present
with_items:
- build-essential
- python2.7-dev
- libffi-dev
- python-pip
- python-setuptools
- sqlite3
- libssl-dev
- python-virtualenv
- libjpeg-dev
- libxslt1-dev
- git
- libpq-dev
tags:
- pre_install
2018-07-30 14:56:33 +00:00
- name: Create virtualenv
pip:
name:
- pip
- setuptools
- lxml
- psycopg2-binary
- mock
virtualenv: /opt/synapse/env
virtualenv_python: python2.7
extra_args: --upgrade
become: true
become_user: synapse
tags:
- pre_install
2018-07-30 14:56:33 +00:00
- name: Clone synapse
git:
repo: https://github.com/matrix-org/synapse
dest: /opt/synapse/synapse
accept_hostkey: yes
version: "{{ matrix_synapse_version }}"
become_user: synapse
become: true
register: clone_synapse
tags:
- pre_install
2018-07-30 14:56:33 +00:00
- name: Install Synapse
pip:
name: /opt/synapse/synapse
virtualenv: /opt/synapse/env
virtualenv_python: python2.7
become_user: synapse
become: true
when: clone_synapse.changed
tags:
- skip_ansible_lint # skip when clause
- pre_install