From e05d4a379b90a3142d895741d2a69cf987912818 Mon Sep 17 00:00:00 2001 From: Salt Date: Sat, 2 Oct 2021 22:03:22 -0500 Subject: [PATCH] Add basic Synapse server configuration --- playbooks/prod_com.yml | 34 +++++++++++++++++++++++++++++++++ playbooks/tasks/web/synapse.yml | 15 +++++++++++++++ site.yml | 1 + 3 files changed, 50 insertions(+) create mode 100755 playbooks/prod_com.yml create mode 100644 playbooks/tasks/web/synapse.yml diff --git a/playbooks/prod_com.yml b/playbooks/prod_com.yml new file mode 100755 index 0000000..07878d3 --- /dev/null +++ b/playbooks/prod_com.yml @@ -0,0 +1,34 @@ +#!/usr/bin/env ansible-playbook +# vim:ft=ansible: +# Webservers +--- +- hosts: com1.desu.ltd + module_defaults: + docker_container: + state: started + restart_policy: unless-stopped + pull: yes + pre_tasks: + - name: ensure docker network + docker_network: name=web + tags: [ docker ] + tasks: + - name: include tasks for applications + include_tasks: tasks/{{ item }} + with_items: + - web/synapse.yml + tags: [ always ] + roles: + - role: backup + vars: + backup_s3backup_list_extra: + - /data + tags: [ backup ] + - role: ingress + vars: + ingress_servers: + - name: matrix.desu.ltd + proxy_pass: http://synapse:8008 + directives: + - "client_max_body_size 0" + tags: [ web, docker, ingress ] diff --git a/playbooks/tasks/web/synapse.yml b/playbooks/tasks/web/synapse.yml new file mode 100644 index 0000000..36c2b13 --- /dev/null +++ b/playbooks/tasks/web/synapse.yml @@ -0,0 +1,15 @@ +# vim:ft=ansible: +- name: docker deploy synapse + docker_container: + name: synapse + image: matrixdotorg/synapse:latest + env: + TZ: "America/Chicago" + SYNAPSE_SERVER_NAME: matrix.desu.ltd + SYNAPSE_REPORT_STATS: "no" + networks: + - name: web + aliases: [ "synapse" ] + volumes: + - /data/synapse:/data + tags: [ docker, synapse ] diff --git a/site.yml b/site.yml index 39d1579..b7c0c43 100755 --- a/site.yml +++ b/site.yml @@ -19,6 +19,7 @@ # Production configuration - import_playbook: playbooks/prod_db.yml - import_playbook: playbooks/prod_web.yml +- import_playbook: playbooks/prod_com.yml - import_playbook: playbooks/prod_game.yml # Supplementary tags - import_playbook: playbooks/tags_ansible.yml