ansible/matrix.yml

75 lines
2.2 KiB
YAML
Raw Normal View History

2019-11-21 16:19:03 +00:00
---
2019-11-28 01:09:17 +00:00
- hosts: scaleway
2019-11-21 16:19:03 +00:00
vars:
matrix_synapse_version: "v1.5.1-py3"
# matrix_synapse_version: "v1.5.1"
2019-11-28 01:09:17 +00:00
matrix_server_name: matrix-test.local
matrix_bind_address: "51.158.114.109"
matrix_synapse_pg_host: synapse-postgres # does it need to be an IP?
matrix_synapse_db_name: psycopg2
matrix_synapse_pg_user: "synapse"
matrix_synapse_pg_pass: "pomme"
matrix_synapse_pg_db: "synapse"
matrix_registration_shared_secret: "xxxxx"
2019-11-21 16:19:03 +00:00
matrix_synapse_report_stats: false
2019-11-28 01:09:17 +00:00
matrix_synapse_config_dir: "/etc/matrix-synapse"
matrix_synapse_config_path: "{{ matrix_synapse_config_dir }}/homeserver.yaml"
matrix_synapse_config_docker_path: "/config/homeserver.yaml"
matrix_synapse_config_docker_dir: "/config"
2019-11-21 16:19:03 +00:00
# to implement
# matrix_no_tls: true
2019-11-21 16:19:03 +00:00
tasks:
# - docker_volume:
# name: synapse-data
2019-11-28 01:09:17 +00:00
- name: Create config directory
file:
path: "{{ matrix_synapse_config_dir }}"
state: directory
2019-11-21 16:19:03 +00:00
- template:
2019-11-28 01:09:17 +00:00
src: templates/homeserver.yaml.j2
dest: "{{ matrix_synapse_config_path }}"
- name: Create config directory
file:
path: "/etc/docker"
state: directory
2019-11-21 16:19:03 +00:00
- template:
src: templates/docker-compose-matrix.yml.j2
dest: /etc/docker/docker-compose.yml
2019-11-21 16:19:03 +00:00
2019-11-28 01:09:17 +00:00
- name: Install required system packages
apt: name={{ item }} state=latest update_cache=yes
loop: [ 'apt-transport-https', 'ca-certificates', 'curl', 'software-properties-common', 'python3-pip']
- name: Add Docker GPG apt Key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Add Docker Repository
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu bionic stable
state: present
- name: Update apt and install docker-ce
apt: update_cache=yes name=docker-ce state=latest
- name: install pip docker
pip: name={{ item }}
loop: ['docker', 'docker-compose']
2019-11-21 16:19:03 +00:00
- name: Create and start matrix services
docker_compose:
2019-11-28 01:09:17 +00:00
project_src: /etc/docker/
register: output
# uploads_path: "/var/lib/matrix-synapse/uploads"
# media_store_path: "/var/lib/matrix-synapse/media"