matrix-synapse/tasks/main.yaml
author Luke Hoersten <luke@hoersten.org>
Tue, 09 Jun 2020 19:14:49 -0500
changeset 39 90b1b7c4be70
parent 37 2ef98b7b40d4
child 43 b86f3fc9fb6f
permissions -rw-r--r--
Added pgsql support for matrix.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36
a8627367c7be Add matrix synapse server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
---
a8627367c7be Add matrix synapse server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
37
2ef98b7b40d4 Updated to buster-backports matrix.
Luke Hoersten <luke@hoersten.org>
parents: 36
diff changeset
     3
- name: add debian backports keys
2ef98b7b40d4 Updated to buster-backports matrix.
Luke Hoersten <luke@hoersten.org>
parents: 36
diff changeset
     4
  become: yes
2ef98b7b40d4 Updated to buster-backports matrix.
Luke Hoersten <luke@hoersten.org>
parents: 36
diff changeset
     5
  apt_key:
39
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
     6
    keyserver: "keyserver.ubuntu.com"
37
2ef98b7b40d4 Updated to buster-backports matrix.
Luke Hoersten <luke@hoersten.org>
parents: 36
diff changeset
     7
    id: "{{item}}"
2ef98b7b40d4 Updated to buster-backports matrix.
Luke Hoersten <luke@hoersten.org>
parents: 36
diff changeset
     8
  loop:
2ef98b7b40d4 Updated to buster-backports matrix.
Luke Hoersten <luke@hoersten.org>
parents: 36
diff changeset
     9
    - "04EE7237B7D453EC"
2ef98b7b40d4 Updated to buster-backports matrix.
Luke Hoersten <luke@hoersten.org>
parents: 36
diff changeset
    10
    - "648ACFD622F3D138"
2ef98b7b40d4 Updated to buster-backports matrix.
Luke Hoersten <luke@hoersten.org>
parents: 36
diff changeset
    11
2ef98b7b40d4 Updated to buster-backports matrix.
Luke Hoersten <luke@hoersten.org>
parents: 36
diff changeset
    12
- name: add matrix repo
2ef98b7b40d4 Updated to buster-backports matrix.
Luke Hoersten <luke@hoersten.org>
parents: 36
diff changeset
    13
  become: yes
2ef98b7b40d4 Updated to buster-backports matrix.
Luke Hoersten <luke@hoersten.org>
parents: 36
diff changeset
    14
  apt_repository: repo="deb http://deb.debian.org/debian buster-backports main"
2ef98b7b40d4 Updated to buster-backports matrix.
Luke Hoersten <luke@hoersten.org>
parents: 36
diff changeset
    15
36
a8627367c7be Add matrix synapse server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    16
- name: install matrix synapse
a8627367c7be Add matrix synapse server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    17
  become: yes
37
2ef98b7b40d4 Updated to buster-backports matrix.
Luke Hoersten <luke@hoersten.org>
parents: 36
diff changeset
    18
  apt:
2ef98b7b40d4 Updated to buster-backports matrix.
Luke Hoersten <luke@hoersten.org>
parents: 36
diff changeset
    19
    name: "matrix-synapse"
2ef98b7b40d4 Updated to buster-backports matrix.
Luke Hoersten <luke@hoersten.org>
parents: 36
diff changeset
    20
    state: "latest"
2ef98b7b40d4 Updated to buster-backports matrix.
Luke Hoersten <luke@hoersten.org>
parents: 36
diff changeset
    21
    default_release: "buster-backports"
2ef98b7b40d4 Updated to buster-backports matrix.
Luke Hoersten <luke@hoersten.org>
parents: 36
diff changeset
    22
  notify: restart matrix synapse service
36
a8627367c7be Add matrix synapse server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    23
a8627367c7be Add matrix synapse server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    24
- name: configure matrix synapse
a8627367c7be Add matrix synapse server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    25
  become: yes
a8627367c7be Add matrix synapse server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    26
  template:
39
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    27
    src: "{{item.src}}"
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    28
    dest: "{{item.dest}}"
36
a8627367c7be Add matrix synapse server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    29
  notify: restart matrix synapse service
39
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    30
  loop:
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    31
    - { src: "homeserver.yaml.j2", dest: "/etc/matrix-synapse/homeserver.yaml" }
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    32
    - { src: "log.yaml.j2", dest: "/etc/matrix-synapse/log.yaml" }
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    33
    - { src: "server_name.yaml.j2", dest: "/etc/matrix-synapse/conf.d/server_name.yaml" }
36
a8627367c7be Add matrix synapse server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    34
39
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    35
- name: install db schema file
36
a8627367c7be Add matrix synapse server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    36
  become: yes
a8627367c7be Add matrix synapse server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    37
  template:
39
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    38
    src: "setup_db.psql.j2"
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    39
    dest: "/tmp/setup_db_{{matrix_synapse_pgsql_db}}.psql"
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    40
    owner: "postgres"
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    41
    group: "postgres"
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    42
    mode: "0600"
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    43
  changed_when: false
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    44
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    45
- name: install psql
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    46
  become: yes
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    47
  become_user: "postgres"
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    48
  command: "psql -f /tmp/setup_db_{{matrix_synapse_pgsql_db}}.psql"
90b1b7c4be70 Added pgsql support for matrix.
Luke Hoersten <luke@hoersten.org>
parents: 37
diff changeset
    49
  changed_when: false
36
a8627367c7be Add matrix synapse server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    50
a8627367c7be Add matrix synapse server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    51
- name: ensure matrix synapse is started
a8627367c7be Add matrix synapse server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    52
  become: yes
a8627367c7be Add matrix synapse server role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    53
  systemd: name="matrix-synapse.service" enabled="yes" state="started"