diff --git a/roles/docker-matrix-compose/tasks/main.yml b/roles/docker-matrix-compose/tasks/main.yml index 63a67a37..670ec566 100644 --- a/roles/docker-matrix-compose/tasks/main.yml +++ b/roles/docker-matrix-compose/tasks/main.yml @@ -86,18 +86,21 @@ - name: flush docker service meta: flush_handlers -- name: wait for containers - pause: - seconds: "{{pause_duration}}" +- name: wait for registration files + wait_for: + path: "{{docker_compose_instance_directory}}{{item.bridge_name}}/registration.yaml" + state: present + timeout: 120 + loop: "{{ bridges }}" -- name: create registration files +- name: move registration files command: - cmd: docker compose exec {{item.bridge_name}} /usr/bin/{{item.bridge_name}} -g -c /data/config.yaml -r {{registration_file_folder}}{{item.bridge_name}}.registration.yaml + cmd: mv {{docker_compose_instance_directory}}{{item.bridge_name}}/registration.yaml {{docker_compose_instance_directory}}registrations/{{item.bridge_name}}.registration.yaml chdir: "{{ docker_compose_instance_directory }}" loop: "{{ bridges }}" -- name: set read and execute permissions for the registration file in the container - command: - cmd: docker compose exec {{item.bridge_name}} chmod a+rx {{registration_file_folder}}{{item.bridge_name}}.registration.yaml - chdir: "{{ docker_compose_instance_directory }}" - loop: "{{ bridges }}" +- name: "change file permissions" + file: + path: "{{docker_compose_instance_directory}}registrations/{{item.bridge_name}}.registration.yaml" + mode: 0755 + loop: "{{ bridges }}" \ No newline at end of file diff --git a/roles/docker-matrix-compose/vars/main.yml b/roles/docker-matrix-compose/vars/main.yml index 81b33223..36eda8e6 100644 --- a/roles/docker-matrix-compose/vars/main.yml +++ b/roles/docker-matrix-compose/vars/main.yml @@ -11,10 +11,10 @@ bridges: database_name: "mautrix_whatsapp_bridge" bridge_name: "mautrix-whatsapp" -# - database_password: "{{ mautrix_telegram_bridge_database_password }}" -# database_username: "mautrix_telegram_bridge" -# database_name: "mautrix_telegram_bridge" -# bridge_name: "mautrix-telegram" + - database_password: "{{ mautrix_telegram_bridge_database_password }}" + database_username: "mautrix_telegram_bridge" + database_name: "mautrix_telegram_bridge" + bridge_name: "mautrix-telegram" - database_password: "{{ mautrix_signal_bridge_database_password }}" database_username: "mautrix_signal_bridge"