From f955aea0d837d1f96d49dc3711b6cbfc734308fb Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Thu, 19 Sep 2019 19:09:41 +0100 Subject: [PATCH] Move from distro-based Matrix install to a matrix.org-based one --- .../matrix_server/tasks/includes/repos.yaml | 19 +++++++++++++++++ .ansible/roles/matrix_server/tasks/main.yaml | 21 ++++++++++++++----- .ansible/roles/matrix_server/vars/main.yaml | 8 +++++++ 3 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 .ansible/roles/matrix_server/tasks/includes/repos.yaml create mode 100644 .ansible/roles/matrix_server/vars/main.yaml diff --git a/.ansible/roles/matrix_server/tasks/includes/repos.yaml b/.ansible/roles/matrix_server/tasks/includes/repos.yaml new file mode 100644 index 0000000..55e7d02 --- /dev/null +++ b/.ansible/roles/matrix_server/tasks/includes/repos.yaml @@ -0,0 +1,19 @@ +- name: includes/repos.yaml + tags: + - install + - repos + - matrix + block: + - name: "Apt repo: Import GPG key: {{ repo.name }}" + apt_key: + state: present + url: "{{ repo.key }}" + when: repo.key + become: true + + - name: "Apt repo: Add repo: {{ repo.name }}" + apt_repository: + state: present + repo: "{{ repo.data }}" + update_cache: yes + become: true diff --git a/.ansible/roles/matrix_server/tasks/main.yaml b/.ansible/roles/matrix_server/tasks/main.yaml index 4ec968e..dd8e2b2 100644 --- a/.ansible/roles/matrix_server/tasks/main.yaml +++ b/.ansible/roles/matrix_server/tasks/main.yaml @@ -1,9 +1,20 @@ -- name: Synapse package +- name: Adding repositories tags: - install + - repos + - matrix + include: includes/repos.yaml + loop: "{{ linux_repos }}" + loop_control: + loop_var: repo + +- name: Installing packages + tags: + - install + - packages - matrix - - synapse package: - name: matrix-synapse - state: latest - become: yes + name: "{{ item }}" + state: present + loop: "{{ linux_packages }}" + become: true diff --git a/.ansible/roles/matrix_server/vars/main.yaml b/.ansible/roles/matrix_server/vars/main.yaml new file mode 100644 index 0000000..2c68119 --- /dev/null +++ b/.ansible/roles/matrix_server/vars/main.yaml @@ -0,0 +1,8 @@ +--- +linux_repos: + - name: 'Matrix Synapse' + data: 'deb https://packages.matrix.org/debian disco main' + key: 'https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg' + +linux_packages: + - matrix-synapse-py3