From 8c1e00a6cd446f40d589b4ecc75a697330e0d11b Mon Sep 17 00:00:00 2001 From: Horvath Gergely Date: Fri, 21 Feb 2020 07:56:28 +0100 Subject: [PATCH] add mautrix-facebook support for raspberry pi --- roles/matrix-base/defaults/main.yml | 1 + roles/matrix-base/tasks/setup_matrix_base.yml | 1 + .../tasks/setup_install.yml | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/roles/matrix-base/defaults/main.yml b/roles/matrix-base/defaults/main.yml index 6dd986e3a..84199623a 100644 --- a/roles/matrix-base/defaults/main.yml +++ b/roles/matrix-base/defaults/main.yml @@ -29,6 +29,7 @@ matrix_static_files_base_path: "{{ matrix_base_data_path }}/static-files" matrix_docker_src_files_path: "{{ matrix_base_data_path }}/docker-src" matrix_docker_synapse_src_files_path: "{{ matrix_docker_src_files_path }}/synapse" matrix_docker_coturn_src_files_path: "{{ matrix_docker_src_files_path }}/coturn" +matrix_docker_mautrix_facebook_src_files_path: "{{ matrix_docker_src_files_path }}/mautrix-facebook" matrix_homeserver_url: "https://{{ matrix_server_fqn_matrix }}" diff --git a/roles/matrix-base/tasks/setup_matrix_base.yml b/roles/matrix-base/tasks/setup_matrix_base.yml index fcf0300e8..aa4177eb6 100644 --- a/roles/matrix-base/tasks/setup_matrix_base.yml +++ b/roles/matrix-base/tasks/setup_matrix_base.yml @@ -25,6 +25,7 @@ - { src: "{{ matrix_docker_src_files_path }}", when: "{{ matrix_raspberry_pi }}" } - { src: "{{ matrix_docker_synapse_src_files_path }}", when: "{{ matrix_raspberry_pi }}" } - { src: "{{ matrix_docker_coturn_src_files_path }}", when: "{{ matrix_coturn_enabled }}"} + - { src: "{{ matrix_docker_mautrix_facebook_src_files_path }}", when: "{{ matrix_mautrix_facebook_enabled }}"} # `docker_network` doesn't work as expected when the given network # is a substring of a network that already exists. diff --git a/roles/matrix-bridge-mautrix-facebook/tasks/setup_install.yml b/roles/matrix-bridge-mautrix-facebook/tasks/setup_install.yml index 68c823c6c..a8c7cdf1a 100644 --- a/roles/matrix-bridge-mautrix-facebook/tasks/setup_install.yml +++ b/roles/matrix-bridge-mautrix-facebook/tasks/setup_install.yml @@ -14,6 +14,25 @@ source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" force_source: "{{ matrix_mautrix_facebook_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_facebook_docker_image_force_pull }}" + when: matrix_mautrix_facebook_enabled|bool and not matrix_raspberry_pi + +- name: Ensure Mautrix Facebook repository is present on Raspberry pi + git: + repo: https://github.com/tulir/mautrix-facebook.git + dest: "{{ matrix_docker_mautrix_facebook_src_files_path }}" +# version: "{{ matrix_coturn_docker_image.split(':')[1] }}" + force: "yes" + when: "matrix_mautrix_facebook_enabled|bool and matrix_raspberry_pi" + +- name: Ensure Mautrix Facebook Docker image is build (Raspberry pi) + docker_image: + name: "{{ matrix_mautrix_facebook_docker_image }}" + source: build + build: + dockerfile: Dockerfile + path: "{{ matrix_docker_mautrix_facebook_src_files_path }}" + pull: yes + when: "matrix_mautrix_facebook_enabled|bool and matrix_raspberry_pi" - name: Ensure Mautrix Facebook paths exist file: