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