From bd6e08a93e6e4913bc87f671a27983dd2a960ee5 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 10 Jun 2026 22:48:03 +0200 Subject: [PATCH] Allow host network mode for MDAD-managed containers (#5310) * feat: support container_network=host across all roles + systemd templates Mirror the pattern Slavi introduced for matrix-coturn (aafa8f0) across the fork: every 'Ensure X container network is created' task gets a 'when: not in ["", "host"]' guard so MDAD does not try to docker_network create a network literally named 'host' (returns 403, since host is a pre-defined Docker network). Mirror the same guard in every systemd unit template that does 'ExecStartPre=docker network connect ' loops over matrix__container_additional_networks: skip the connects when the container is on host networking (where additional --network attaches are invalid). Unblocks DiD setups where MDAD-managed containers share their host's network namespace (matrix-mdad outer compose service joined to central postgres/openldap networks) to reach external services on the outer Docker daemon. * Simplify container network guards (!= 'host') and fix duplicate when Guarding on the empty string ('') as well was misleading: systemd unit templates still render an unconditional --network= flag, so an empty network value produces a broken docker create command. Only 'host' is actually supported, so only guard on that. This also matches the existing convention in the Traefik role (when: traefik_container_network != 'host'). Also fix a duplicate when key in the meshtastic-relay role, where the network-creation task already had a when condition - the two are now combined into a list. Co-Authored-By: Claude Fable 5 --------- Co-authored-by: Slavi Pantaleev Co-authored-by: Claude Fable 5 --- .../custom/matrix-alertmanager-receiver/tasks/install.yml | 1 + .../systemd/matrix-alertmanager-receiver.service.j2 | 2 ++ .../tasks/setup_install.yml | 1 + .../systemd/matrix-appservice-draupnir-for-all.service.j2 | 2 ++ .../matrix-authentication-service/tasks/install.yml | 1 + .../systemd/matrix-authentication-service.service.j2 | 2 ++ roles/custom/matrix-bot-baibot/tasks/install.yml | 1 + .../templates/systemd/matrix-bot-baibot.service.j2 | 2 ++ roles/custom/matrix-bot-buscarron/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-bot-buscarron.service.j2 | 2 ++ roles/custom/matrix-bot-draupnir/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-bot-draupnir.service.j2 | 2 ++ roles/custom/matrix-bot-honoroit/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-bot-honoroit.service.j2 | 2 ++ .../tasks/setup_install.yml | 1 + .../systemd/matrix-bot-matrix-registration-bot.service.j2 | 2 ++ .../tasks/setup_install.yml | 1 + .../systemd/matrix-bot-matrix-reminder-bot.service.j2 | 2 ++ roles/custom/matrix-bot-maubot/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-bot-maubot.service.j2 | 2 ++ roles/custom/matrix-bot-mjolnir/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-bot-mjolnir.service.j2 | 2 ++ .../tasks/setup_install.yml | 1 + .../systemd/matrix-appservice-discord.service.j2 | 2 ++ .../matrix-bridge-appservice-irc/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-appservice-irc.service.j2 | 2 ++ .../tasks/setup_install.yml | 1 + .../systemd/matrix-appservice-kakaotalk-node.service.j2 | 2 ++ .../systemd/matrix-appservice-kakaotalk.service.j2 | 2 ++ .../matrix-bridge-beeper-linkedin/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-beeper-linkedin.service.j2 | 2 ++ .../matrix-bridge-heisenbridge/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-heisenbridge.service.j2 | 2 ++ .../custom/matrix-bridge-hookshot/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-hookshot.service.j2 | 2 ++ .../matrix-bridge-mautrix-bluesky/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-mautrix-bluesky.service.j2 | 2 ++ .../matrix-bridge-mautrix-discord/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-mautrix-discord.service.j2 | 2 ++ .../tasks/setup_install.yml | 1 + .../templates/systemd/matrix-mautrix-gmessages.service.j2 | 2 ++ .../tasks/setup_install.yml | 1 + .../systemd/matrix-mautrix-googlechat.service.j2 | 2 ++ .../tasks/install.yml | 1 + .../templates/systemd/matrix-mautrix-meta.service.j2 | 2 ++ .../tasks/install.yml | 1 + .../templates/systemd/matrix-mautrix-meta.service.j2 | 2 ++ .../matrix-bridge-mautrix-signal/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-mautrix-signal.service.j2 | 2 ++ .../matrix-bridge-mautrix-slack/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-mautrix-slack.service.j2 | 2 ++ .../tasks/setup_install.yml | 1 + .../templates/systemd/matrix-mautrix-telegram.service.j2 | 2 ++ .../matrix-bridge-mautrix-twitter/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-mautrix-twitter.service.j2 | 2 ++ .../tasks/setup_install.yml | 1 + .../templates/systemd/matrix-mautrix-whatsapp.service.j2 | 2 ++ .../matrix-bridge-mautrix-wsproxy/tasks/setup_install.yml | 1 + .../systemd/matrix-mautrix-wsproxy-syncproxy.service.j2 | 2 ++ .../templates/systemd/matrix-mautrix-wsproxy.service.j2 | 2 ++ .../tasks/setup_install.yml | 4 +++- .../templates/systemd/matrix-meshtastic-relay.service.j2 | 2 ++ .../tasks/setup_install.yml | 1 + .../templates/systemd/matrix-mx-puppet-groupme.service.j2 | 2 ++ .../matrix-bridge-mx-puppet-steam/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-mx-puppet-steam.service.j2 | 2 ++ .../matrix-bridge-postmoogle/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-postmoogle.service.j2 | 2 ++ roles/custom/matrix-bridge-sms/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-sms-bridge.service.j2 | 2 ++ roles/custom/matrix-bridge-steam/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-steam-bridge.service.j2 | 2 ++ roles/custom/matrix-bridge-wechat/tasks/install.yml | 1 + .../templates/systemd/matrix-wechat-agent.service.j2 | 2 ++ .../templates/systemd/matrix-wechat.service.j2 | 2 ++ .../matrix-cactus-comments-client/tasks/install.yml | 1 + .../systemd/matrix-cactus-comments-client.service.j2 | 2 ++ .../templates/systemd/matrix-cactus-comments.service.j2 | 2 ++ roles/custom/matrix-client-commet/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-client-commet.service.j2 | 2 ++ .../custom/matrix-client-element/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-client-element.service.j2 | 2 ++ .../matrix-client-fluffychat/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-client-fluffychat.service.j2 | 2 ++ .../matrix-client-schildichat/tasks/setup_install.yml | 1 + .../systemd/matrix-client-schildichat.service.j2 | 2 ++ roles/custom/matrix-conduit/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-conduit.service.j2 | 2 ++ roles/custom/matrix-continuwuity/tasks/install.yml | 1 + roles/custom/matrix-continuwuity/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-continuwuity.service.j2 | 2 ++ roles/custom/matrix-corporal/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-corporal.service.j2 | 2 ++ roles/custom/matrix-dendrite/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-dendrite.service.j2 | 2 ++ roles/custom/matrix-element-admin/tasks/install.yml | 1 + .../templates/systemd/matrix-element-admin.service.j2 | 2 ++ roles/custom/matrix-element-call/tasks/install.yml | 1 + .../templates/systemd/matrix-element-call.service.j2 | 2 ++ roles/custom/matrix-ketesa/tasks/setup_install.yml | 1 + .../templates/systemd/matrix-ketesa.service.j2 | 2 ++ roles/custom/matrix-livekit-jwt-service/tasks/install.yml | 1 + .../systemd/matrix-livekit-jwt-service.service.j2 | 2 ++ roles/custom/matrix-matrixto/tasks/install.yml | 8 ++++++-- .../templates/systemd/matrix-matrixto.service.j2 | 2 ++ roles/custom/matrix-media-repo/tasks/setup_install.yml | 1 + .../media-repo/systemd/matrix-media-repo.service.j2 | 2 ++ roles/custom/matrix-pantalaimon/tasks/install.yml | 1 + .../templates/systemd/matrix-pantalaimon.service.j2 | 2 ++ roles/custom/matrix-rageshake/tasks/install.yml | 1 + .../templates/systemd/matrix-rageshake.service.j2 | 2 ++ roles/custom/matrix-static-files/tasks/install.yml | 1 + .../templates/systemd/matrix-static-files.service.j2 | 2 ++ roles/custom/matrix-sygnal/tasks/install.yml | 1 + .../templates/systemd/matrix-sygnal.service.j2 | 2 ++ .../matrix-synapse-auto-compressor/tasks/install.yml | 1 + .../templates/matrix-synapse-auto-compressor.service.j2 | 2 ++ .../matrix-synapse-usage-exporter/tasks/setup_install.yml | 1 + .../systemd/matrix-synapse-usage-exporter.service.j2 | 2 ++ .../tasks/reverse_proxy_companion/setup_install.yml | 1 + .../custom/matrix-synapse/tasks/synapse/setup_install.yml | 1 + .../matrix-synapse-reverse-proxy-companion.service.j2 | 2 ++ .../synapse/systemd/matrix-synapse-worker.service.j2 | 2 ++ .../templates/synapse/systemd/matrix-synapse.service.j2 | 2 ++ roles/custom/matrix-tuwunel/tasks/install.yml | 1 + .../templates/systemd/matrix-tuwunel.service.j2 | 2 ++ .../tasks/setup_install.yml | 1 + .../systemd/matrix-user-verification-service.service.j2 | 2 ++ 128 files changed, 201 insertions(+), 3 deletions(-) diff --git a/roles/custom/matrix-alertmanager-receiver/tasks/install.yml b/roles/custom/matrix-alertmanager-receiver/tasks/install.yml index 1cd9615a8..97572b53f 100644 --- a/roles/custom/matrix-alertmanager-receiver/tasks/install.yml +++ b/roles/custom/matrix-alertmanager-receiver/tasks/install.yml @@ -73,6 +73,7 @@ changed_when: true - name: Ensure matrix-alertmanager-receiver container network is created + when: matrix_alertmanager_receiver_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_alertmanager_receiver_container_network }}" diff --git a/roles/custom/matrix-alertmanager-receiver/templates/systemd/matrix-alertmanager-receiver.service.j2 b/roles/custom/matrix-alertmanager-receiver/templates/systemd/matrix-alertmanager-receiver.service.j2 index adb997d56..07d7d31cd 100644 --- a/roles/custom/matrix-alertmanager-receiver/templates/systemd/matrix-alertmanager-receiver.service.j2 +++ b/roles/custom/matrix-alertmanager-receiver/templates/systemd/matrix-alertmanager-receiver.service.j2 @@ -33,9 +33,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ --config-path=/config/config.yml {{ matrix_alertmanager_receiver_container_process_extra_arguments | join(' ') }} \ --log-level={{ matrix_alertmanager_receiver_container_process_argument_log_level }} +{% if matrix_alertmanager_receiver_container_network != 'host' %} {% for network in matrix_alertmanager_receiver_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-alertmanager-receiver {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-alertmanager-receiver diff --git a/roles/custom/matrix-appservice-draupnir-for-all/tasks/setup_install.yml b/roles/custom/matrix-appservice-draupnir-for-all/tasks/setup_install.yml index 7c9d582e7..b1b1d1dbf 100644 --- a/roles/custom/matrix-appservice-draupnir-for-all/tasks/setup_install.yml +++ b/roles/custom/matrix-appservice-draupnir-for-all/tasks/setup_install.yml @@ -88,6 +88,7 @@ register: matrix_appservice_draupnir_for_all_registration_config_result - name: Ensure matrix-appservice-draupnir-for-all container network is created + when: matrix_appservice_draupnir_for_all_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_appservice_draupnir_for_all_container_network }}" diff --git a/roles/custom/matrix-appservice-draupnir-for-all/templates/systemd/matrix-appservice-draupnir-for-all.service.j2 b/roles/custom/matrix-appservice-draupnir-for-all/templates/systemd/matrix-appservice-draupnir-for-all.service.j2 index 43ae9e610..8dc631ad8 100644 --- a/roles/custom/matrix-appservice-draupnir-for-all/templates/systemd/matrix-appservice-draupnir-for-all.service.j2 +++ b/roles/custom/matrix-appservice-draupnir-for-all/templates/systemd/matrix-appservice-draupnir-for-all.service.j2 @@ -32,9 +32,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_appservice_draupnir_for_all_container_image }} \ appservice -c /data/config/production-appservice.yaml -f /data/config/draupnir-for-all-registration.yaml -p {{ matrix_appservice_draupnir_for_all_appservice_port }} --draupnir-config /data/config/production-bots.yaml +{% if matrix_appservice_draupnir_for_all_container_network != 'host' %} {% for network in matrix_appservice_draupnir_for_all_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-appservice-draupnir-for-all {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-appservice-draupnir-for-all diff --git a/roles/custom/matrix-authentication-service/tasks/install.yml b/roles/custom/matrix-authentication-service/tasks/install.yml index 546fc4802..f13415f6a 100644 --- a/roles/custom/matrix-authentication-service/tasks/install.yml +++ b/roles/custom/matrix-authentication-service/tasks/install.yml @@ -114,6 +114,7 @@ changed_when: true - name: Ensure Matrix Authentication Service container network is created + when: matrix_authentication_service_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_authentication_service_container_network }}" diff --git a/roles/custom/matrix-authentication-service/templates/systemd/matrix-authentication-service.service.j2 b/roles/custom/matrix-authentication-service/templates/systemd/matrix-authentication-service.service.j2 index b91535e4b..ceb353f22 100644 --- a/roles/custom/matrix-authentication-service/templates/systemd/matrix-authentication-service.service.j2 +++ b/roles/custom/matrix-authentication-service/templates/systemd/matrix-authentication-service.service.j2 @@ -36,9 +36,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_authentication_service_container_image }} +{% if matrix_authentication_service_container_network != 'host' %} {% for network in matrix_authentication_service_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-authentication-service {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-authentication-service diff --git a/roles/custom/matrix-bot-baibot/tasks/install.yml b/roles/custom/matrix-bot-baibot/tasks/install.yml index 47ae5bd56..e31057943 100644 --- a/roles/custom/matrix-bot-baibot/tasks/install.yml +++ b/roles/custom/matrix-bot-baibot/tasks/install.yml @@ -69,6 +69,7 @@ register: matrix_bot_baibot_container_image_build_result - name: Ensure baibot container network is created + when: matrix_bot_baibot_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_bot_baibot_container_network }}" diff --git a/roles/custom/matrix-bot-baibot/templates/systemd/matrix-bot-baibot.service.j2 b/roles/custom/matrix-bot-baibot/templates/systemd/matrix-bot-baibot.service.j2 index e9b01fb0a..3483b086b 100644 --- a/roles/custom/matrix-bot-baibot/templates/systemd/matrix-bot-baibot.service.j2 +++ b/roles/custom/matrix-bot-baibot/templates/systemd/matrix-bot-baibot.service.j2 @@ -37,9 +37,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_bot_baibot_container_image }} +{% if matrix_bot_baibot_container_network != 'host' %} {% for network in matrix_bot_baibot_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-bot-baibot {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-bot-baibot diff --git a/roles/custom/matrix-bot-buscarron/tasks/setup_install.yml b/roles/custom/matrix-bot-buscarron/tasks/setup_install.yml index 953654f01..e71713bfe 100644 --- a/roles/custom/matrix-bot-buscarron/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-buscarron/tasks/setup_install.yml @@ -110,6 +110,7 @@ }} - name: Ensure Buscarron container network is created + when: matrix_bot_buscarron_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_bot_buscarron_container_network }}" diff --git a/roles/custom/matrix-bot-buscarron/templates/systemd/matrix-bot-buscarron.service.j2 b/roles/custom/matrix-bot-buscarron/templates/systemd/matrix-bot-buscarron.service.j2 index e108741d8..69c22f4c4 100644 --- a/roles/custom/matrix-bot-buscarron/templates/systemd/matrix-bot-buscarron.service.j2 +++ b/roles/custom/matrix-bot-buscarron/templates/systemd/matrix-bot-buscarron.service.j2 @@ -32,9 +32,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_bot_buscarron_container_image }} +{% if matrix_bot_buscarron_container_network != 'host' %} {% for network in matrix_bot_buscarron_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-bot-buscarron {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-bot-buscarron diff --git a/roles/custom/matrix-bot-draupnir/tasks/setup_install.yml b/roles/custom/matrix-bot-draupnir/tasks/setup_install.yml index 9387c00a3..efe7bba24 100644 --- a/roles/custom/matrix-bot-draupnir/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-draupnir/tasks/setup_install.yml @@ -82,6 +82,7 @@ register: matrix_bot_draupnir_config_result - name: Ensure matrix-bot-draupnir container network is created + when: matrix_bot_draupnir_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_bot_draupnir_container_network }}" diff --git a/roles/custom/matrix-bot-draupnir/templates/systemd/matrix-bot-draupnir.service.j2 b/roles/custom/matrix-bot-draupnir/templates/systemd/matrix-bot-draupnir.service.j2 index debcc7644..75438e5b0 100644 --- a/roles/custom/matrix-bot-draupnir/templates/systemd/matrix-bot-draupnir.service.j2 +++ b/roles/custom/matrix-bot-draupnir/templates/systemd/matrix-bot-draupnir.service.j2 @@ -36,9 +36,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_bot_draupnir_container_image }} \ bot --draupnir-config /data/config/production.yaml +{% if matrix_bot_draupnir_container_network != 'host' %} {% for network in matrix_bot_draupnir_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-bot-draupnir {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-bot-draupnir diff --git a/roles/custom/matrix-bot-honoroit/tasks/setup_install.yml b/roles/custom/matrix-bot-honoroit/tasks/setup_install.yml index 8392295f0..bd861d9b3 100644 --- a/roles/custom/matrix-bot-honoroit/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-honoroit/tasks/setup_install.yml @@ -94,6 +94,7 @@ register: matrix_bot_honoroit_container_image_build_result - name: Ensure Honoroit container network is created + when: matrix_bot_honoroit_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_bot_honoroit_container_network }}" diff --git a/roles/custom/matrix-bot-honoroit/templates/systemd/matrix-bot-honoroit.service.j2 b/roles/custom/matrix-bot-honoroit/templates/systemd/matrix-bot-honoroit.service.j2 index 7ffc8313a..dd802eb6b 100644 --- a/roles/custom/matrix-bot-honoroit/templates/systemd/matrix-bot-honoroit.service.j2 +++ b/roles/custom/matrix-bot-honoroit/templates/systemd/matrix-bot-honoroit.service.j2 @@ -32,9 +32,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_bot_honoroit_container_image }} +{% if matrix_bot_honoroit_container_network != 'host' %} {% for network in matrix_bot_honoroit_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-bot-honoroit {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-bot-honoroit diff --git a/roles/custom/matrix-bot-matrix-registration-bot/tasks/setup_install.yml b/roles/custom/matrix-bot-matrix-registration-bot/tasks/setup_install.yml index b88638e59..edc2a0dad 100644 --- a/roles/custom/matrix-bot-matrix-registration-bot/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-matrix-registration-bot/tasks/setup_install.yml @@ -62,6 +62,7 @@ register: matrix_bot_matrix_registration_bot_container_image_build_result - name: Ensure matrix-registration-bot container network is created + when: matrix_bot_matrix_registration_bot_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_bot_matrix_registration_bot_container_network }}" diff --git a/roles/custom/matrix-bot-matrix-registration-bot/templates/systemd/matrix-bot-matrix-registration-bot.service.j2 b/roles/custom/matrix-bot-matrix-registration-bot/templates/systemd/matrix-bot-matrix-registration-bot.service.j2 index e9f0c4204..623cff3d1 100644 --- a/roles/custom/matrix-bot-matrix-registration-bot/templates/systemd/matrix-bot-matrix-registration-bot.service.j2 +++ b/roles/custom/matrix-bot-matrix-registration-bot/templates/systemd/matrix-bot-matrix-registration-bot.service.j2 @@ -29,9 +29,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ --network={{ matrix_bot_matrix_registration_bot_container_network }} \ {{ matrix_bot_matrix_registration_bot_container_image }} +{% if matrix_bot_matrix_registration_bot_container_network != 'host' %} {% for network in matrix_bot_matrix_registration_bot_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-bot-matrix-registration-bot {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-bot-matrix-registration-bot diff --git a/roles/custom/matrix-bot-matrix-reminder-bot/tasks/setup_install.yml b/roles/custom/matrix-bot-matrix-reminder-bot/tasks/setup_install.yml index 72cadef15..1c2c0af65 100644 --- a/roles/custom/matrix-bot-matrix-reminder-bot/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-matrix-reminder-bot/tasks/setup_install.yml @@ -93,6 +93,7 @@ register: matrix_bot_matrix_reminder_bot_config_result - name: Ensure matrix-reminder-bot container network is created + when: matrix_bot_matrix_reminder_bot_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_bot_matrix_reminder_bot_container_network }}" diff --git a/roles/custom/matrix-bot-matrix-reminder-bot/templates/systemd/matrix-bot-matrix-reminder-bot.service.j2 b/roles/custom/matrix-bot-matrix-reminder-bot/templates/systemd/matrix-bot-matrix-reminder-bot.service.j2 index 4fb64420b..263ca1131 100644 --- a/roles/custom/matrix-bot-matrix-reminder-bot/templates/systemd/matrix-bot-matrix-reminder-bot.service.j2 +++ b/roles/custom/matrix-bot-matrix-reminder-bot/templates/systemd/matrix-bot-matrix-reminder-bot.service.j2 @@ -34,9 +34,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_bot_matrix_reminder_bot_container_image }} \ -c "matrix-reminder-bot /config/config.yaml" +{% if matrix_bot_matrix_reminder_bot_container_network != 'host' %} {% for network in matrix_bot_matrix_reminder_bot_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-bot-matrix-reminder-bot {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-bot-matrix-reminder-bot diff --git a/roles/custom/matrix-bot-maubot/tasks/setup_install.yml b/roles/custom/matrix-bot-maubot/tasks/setup_install.yml index b711dad17..3ae13bc59 100644 --- a/roles/custom/matrix-bot-maubot/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-maubot/tasks/setup_install.yml @@ -98,6 +98,7 @@ register: matrix_bot_maubot_support_files_result - name: Ensure maubot container network is created + when: matrix_bot_maubot_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_bot_maubot_container_network }}" diff --git a/roles/custom/matrix-bot-maubot/templates/systemd/matrix-bot-maubot.service.j2 b/roles/custom/matrix-bot-maubot/templates/systemd/matrix-bot-maubot.service.j2 index eddacdf8c..6e0206f8f 100644 --- a/roles/custom/matrix-bot-maubot/templates/systemd/matrix-bot-maubot.service.j2 +++ b/roles/custom/matrix-bot-maubot/templates/systemd/matrix-bot-maubot.service.j2 @@ -41,9 +41,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_bot_maubot_container_image_final }} \ python3 -m maubot -c /config/config.yaml --no-update +{% if matrix_bot_maubot_container_network != 'host' %} {% for network in matrix_bot_maubot_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-bot-maubot {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-bot-maubot diff --git a/roles/custom/matrix-bot-mjolnir/tasks/setup_install.yml b/roles/custom/matrix-bot-mjolnir/tasks/setup_install.yml index 2d8a367aa..92e8bd4d7 100644 --- a/roles/custom/matrix-bot-mjolnir/tasks/setup_install.yml +++ b/roles/custom/matrix-bot-mjolnir/tasks/setup_install.yml @@ -68,6 +68,7 @@ register: matrix_bot_mjolnir_config_result - name: Ensure matrix-bot-mjolnir container network is created + when: matrix_bot_mjolnir_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_bot_mjolnir_container_network }}" diff --git a/roles/custom/matrix-bot-mjolnir/templates/systemd/matrix-bot-mjolnir.service.j2 b/roles/custom/matrix-bot-mjolnir/templates/systemd/matrix-bot-mjolnir.service.j2 index 03a49407e..840264c7e 100644 --- a/roles/custom/matrix-bot-mjolnir/templates/systemd/matrix-bot-mjolnir.service.j2 +++ b/roles/custom/matrix-bot-mjolnir/templates/systemd/matrix-bot-mjolnir.service.j2 @@ -32,9 +32,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_bot_mjolnir_container_image }} \ bot --mjolnir-config /data/config/production.yaml +{% if matrix_bot_mjolnir_container_network != 'host' %} {% for network in matrix_bot_mjolnir_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-bot-mjolnir {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-bot-mjolnir diff --git a/roles/custom/matrix-bridge-appservice-discord/tasks/setup_install.yml b/roles/custom/matrix-bridge-appservice-discord/tasks/setup_install.yml index 8055a50fd..6a64c0a8a 100644 --- a/roles/custom/matrix-bridge-appservice-discord/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-appservice-discord/tasks/setup_install.yml @@ -118,6 +118,7 @@ changed_when: false - name: Ensure matrix-appservice-discord container network is created + when: matrix_appservice_discord_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_appservice_discord_container_network }}" diff --git a/roles/custom/matrix-bridge-appservice-discord/templates/systemd/matrix-appservice-discord.service.j2 b/roles/custom/matrix-bridge-appservice-discord/templates/systemd/matrix-appservice-discord.service.j2 index 238e72cb3..54c66065a 100644 --- a/roles/custom/matrix-bridge-appservice-discord/templates/systemd/matrix-appservice-discord.service.j2 +++ b/roles/custom/matrix-bridge-appservice-discord/templates/systemd/matrix-appservice-discord.service.j2 @@ -34,9 +34,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_appservice_discord_container_image }} \ node /build/src/discordas.js -p 9005 -c /cfg/config.yaml -f /cfg/registration.yaml +{% if matrix_appservice_discord_container_network != 'host' %} {% for network in matrix_appservice_discord_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-appservice-discord {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-appservice-discord diff --git a/roles/custom/matrix-bridge-appservice-irc/tasks/setup_install.yml b/roles/custom/matrix-bridge-appservice-irc/tasks/setup_install.yml index 8dd3038ad..fc7d148f0 100644 --- a/roles/custom/matrix-bridge-appservice-irc/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-appservice-irc/tasks/setup_install.yml @@ -245,6 +245,7 @@ register: matrix_appservice_irc_registration_result - name: Ensure matrix-appservice-irc container network is created + when: matrix_appservice_irc_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_appservice_irc_container_network }}" diff --git a/roles/custom/matrix-bridge-appservice-irc/templates/systemd/matrix-appservice-irc.service.j2 b/roles/custom/matrix-bridge-appservice-irc/templates/systemd/matrix-appservice-irc.service.j2 index 24a5d156b..82998c5f2 100644 --- a/roles/custom/matrix-bridge-appservice-irc/templates/systemd/matrix-appservice-irc.service.j2 +++ b/roles/custom/matrix-bridge-appservice-irc/templates/systemd/matrix-appservice-irc.service.j2 @@ -39,9 +39,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_appservice_irc_container_image }} \ -c 'node app.js -c /config/config.yaml -f /config/registration.yaml -p 9999' +{% if matrix_appservice_irc_container_network != 'host' %} {% for network in matrix_appservice_irc_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-appservice-irc {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-appservice-irc diff --git a/roles/custom/matrix-bridge-appservice-kakaotalk/tasks/setup_install.yml b/roles/custom/matrix-bridge-appservice-kakaotalk/tasks/setup_install.yml index db6979530..e5fcdbb7d 100644 --- a/roles/custom/matrix-bridge-appservice-kakaotalk/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-appservice-kakaotalk/tasks/setup_install.yml @@ -99,6 +99,7 @@ register: matrix_appservice_kakaotalk_registration_result - name: Ensure matrix-appservice-kakaotalk container network is created + when: matrix_appservice_kakaotalk_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_appservice_kakaotalk_container_network }}" diff --git a/roles/custom/matrix-bridge-appservice-kakaotalk/templates/systemd/matrix-appservice-kakaotalk-node.service.j2 b/roles/custom/matrix-bridge-appservice-kakaotalk/templates/systemd/matrix-appservice-kakaotalk-node.service.j2 index 266f3cdaa..2ddfe50a1 100644 --- a/roles/custom/matrix-bridge-appservice-kakaotalk/templates/systemd/matrix-appservice-kakaotalk-node.service.j2 +++ b/roles/custom/matrix-bridge-appservice-kakaotalk/templates/systemd/matrix-appservice-kakaotalk-node.service.j2 @@ -30,9 +30,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_appservice_kakaotalk_node_container_image }} \ node src/main.js --config /config.json +{% if matrix_appservice_kakaotalk_container_network != 'host' %} {% for network in matrix_appservice_kakaotalk_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-appservice-kakaotalk-node {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-appservice-kakaotalk-node diff --git a/roles/custom/matrix-bridge-appservice-kakaotalk/templates/systemd/matrix-appservice-kakaotalk.service.j2 b/roles/custom/matrix-bridge-appservice-kakaotalk/templates/systemd/matrix-appservice-kakaotalk.service.j2 index e65572b55..dd85536df 100644 --- a/roles/custom/matrix-bridge-appservice-kakaotalk/templates/systemd/matrix-appservice-kakaotalk.service.j2 +++ b/roles/custom/matrix-bridge-appservice-kakaotalk/templates/systemd/matrix-appservice-kakaotalk.service.j2 @@ -31,9 +31,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_appservice_kakaotalk_container_image }} \ python3 -m matrix_appservice_kakaotalk -c /config/config.yaml --no-update +{% if matrix_appservice_discord_container_network != 'host' %} {% for network in matrix_appservice_discord_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-appservice-kakaotalk {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-appservice-kakaotalk diff --git a/roles/custom/matrix-bridge-beeper-linkedin/tasks/setup_install.yml b/roles/custom/matrix-bridge-beeper-linkedin/tasks/setup_install.yml index b47384527..19cf6f27b 100644 --- a/roles/custom/matrix-bridge-beeper-linkedin/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-beeper-linkedin/tasks/setup_install.yml @@ -92,6 +92,7 @@ register: matrix_beeper_linkedin_container_image_build_result - name: Ensure beeper-linkedin container network is created + when: matrix_beeper_linkedin_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_beeper_linkedin_container_network }}" diff --git a/roles/custom/matrix-bridge-beeper-linkedin/templates/systemd/matrix-beeper-linkedin.service.j2 b/roles/custom/matrix-bridge-beeper-linkedin/templates/systemd/matrix-beeper-linkedin.service.j2 index 327813430..65f796a80 100644 --- a/roles/custom/matrix-bridge-beeper-linkedin/templates/systemd/matrix-beeper-linkedin.service.j2 +++ b/roles/custom/matrix-bridge-beeper-linkedin/templates/systemd/matrix-beeper-linkedin.service.j2 @@ -31,9 +31,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_beeper_linkedin_container_image }} \ python3 -m linkedin_matrix -c /config/config.yaml -r /config/registration.yaml --no-update +{% if matrix_beeper_linkedin_container_network != 'host' %} {% for network in matrix_beeper_linkedin_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-beeper-linkedin {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-beeper-linkedin diff --git a/roles/custom/matrix-bridge-heisenbridge/tasks/setup_install.yml b/roles/custom/matrix-bridge-heisenbridge/tasks/setup_install.yml index 20f85f373..9241bfaa0 100644 --- a/roles/custom/matrix-bridge-heisenbridge/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-heisenbridge/tasks/setup_install.yml @@ -50,6 +50,7 @@ register: matrix_heisenbridge_support_files_result - name: Ensure Heisenbridge container network is created + when: matrix_heisenbridge_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_heisenbridge_container_network }}" diff --git a/roles/custom/matrix-bridge-heisenbridge/templates/systemd/matrix-heisenbridge.service.j2 b/roles/custom/matrix-bridge-heisenbridge/templates/systemd/matrix-heisenbridge.service.j2 index e653ad2e8..64c9f6231 100644 --- a/roles/custom/matrix-bridge-heisenbridge/templates/systemd/matrix-heisenbridge.service.j2 +++ b/roles/custom/matrix-bridge-heisenbridge/templates/systemd/matrix-heisenbridge.service.j2 @@ -44,9 +44,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ --listen-port 9898 \ {{ matrix_heisenbridge_homeserver_url }} +{% if matrix_heisenbridge_container_network != 'host' %} {% for network in matrix_heisenbridge_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-heisenbridge {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-heisenbridge diff --git a/roles/custom/matrix-bridge-hookshot/tasks/setup_install.yml b/roles/custom/matrix-bridge-hookshot/tasks/setup_install.yml index 7868e0a75..2c86faed0 100644 --- a/roles/custom/matrix-bridge-hookshot/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-hookshot/tasks/setup_install.yml @@ -133,6 +133,7 @@ register: matrix_hookshot_github_key_result - name: Ensure matrix-hookshot container network is created + when: matrix_hookshot_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_hookshot_container_network }}" diff --git a/roles/custom/matrix-bridge-hookshot/templates/systemd/matrix-hookshot.service.j2 b/roles/custom/matrix-bridge-hookshot/templates/systemd/matrix-hookshot.service.j2 index 3e56816ba..983be0a54 100644 --- a/roles/custom/matrix-bridge-hookshot/templates/systemd/matrix-hookshot.service.j2 +++ b/roles/custom/matrix-bridge-hookshot/templates/systemd/matrix-hookshot.service.j2 @@ -30,9 +30,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create --rm - {% endfor %} {{ matrix_hookshot_container_image }} +{% if matrix_hookshot_container_network != 'host' %} {% for network in matrix_hookshot_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} {{ matrix_hookshot_identifier }} {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach {{ matrix_hookshot_identifier }} diff --git a/roles/custom/matrix-bridge-mautrix-bluesky/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-bluesky/tasks/setup_install.yml index 8c92ad6be..70f991728 100644 --- a/roles/custom/matrix-bridge-mautrix-bluesky/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-bluesky/tasks/setup_install.yml @@ -82,6 +82,7 @@ register: matrix_mautrix_bluesky_support_files_result - name: Ensure matrix-mautrix-bluesky container network is created + when: matrix_mautrix_bluesky_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_bluesky_container_network }}" diff --git a/roles/custom/matrix-bridge-mautrix-bluesky/templates/systemd/matrix-mautrix-bluesky.service.j2 b/roles/custom/matrix-bridge-mautrix-bluesky/templates/systemd/matrix-mautrix-bluesky.service.j2 index 54f514bd1..22117f643 100644 --- a/roles/custom/matrix-bridge-mautrix-bluesky/templates/systemd/matrix-mautrix-bluesky.service.j2 +++ b/roles/custom/matrix-bridge-mautrix-bluesky/templates/systemd/matrix-mautrix-bluesky.service.j2 @@ -32,9 +32,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_mautrix_bluesky_container_image }} \ /usr/bin/mautrix-bluesky -c /config/config.yaml -r /config/registration.yaml --no-update +{% if matrix_mautrix_bluesky_container_network != 'host' %} {% for network in matrix_mautrix_bluesky_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mautrix-bluesky {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mautrix-bluesky diff --git a/roles/custom/matrix-bridge-mautrix-discord/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-discord/tasks/setup_install.yml index 1df84cbd4..8136d846c 100644 --- a/roles/custom/matrix-bridge-mautrix-discord/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-discord/tasks/setup_install.yml @@ -110,6 +110,7 @@ register: matrix_mautrix_discord_support_files_result - name: Ensure mautrix-discord container network is created + when: matrix_mautrix_discord_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_discord_container_network }}" diff --git a/roles/custom/matrix-bridge-mautrix-discord/templates/systemd/matrix-mautrix-discord.service.j2 b/roles/custom/matrix-bridge-mautrix-discord/templates/systemd/matrix-mautrix-discord.service.j2 index 770ef59dc..e603c1bbf 100644 --- a/roles/custom/matrix-bridge-mautrix-discord/templates/systemd/matrix-mautrix-discord.service.j2 +++ b/roles/custom/matrix-bridge-mautrix-discord/templates/systemd/matrix-mautrix-discord.service.j2 @@ -33,9 +33,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_mautrix_discord_container_image }} \ /usr/bin/mautrix-discord -c /config/config.yaml -r /config/registration.yaml --no-update +{% if matrix_mautrix_discord_container_network != 'host' %} {% for network in matrix_mautrix_discord_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mautrix-discord {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mautrix-discord diff --git a/roles/custom/matrix-bridge-mautrix-gmessages/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-gmessages/tasks/setup_install.yml index 1c674b6a3..02eda18d0 100644 --- a/roles/custom/matrix-bridge-mautrix-gmessages/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-gmessages/tasks/setup_install.yml @@ -150,6 +150,7 @@ register: matrix_mautrix_gmessages_support_files_result - name: Ensure matrix-mautrix-gmessages container network is created + when: matrix_mautrix_gmessages_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_gmessages_container_network }}" diff --git a/roles/custom/matrix-bridge-mautrix-gmessages/templates/systemd/matrix-mautrix-gmessages.service.j2 b/roles/custom/matrix-bridge-mautrix-gmessages/templates/systemd/matrix-mautrix-gmessages.service.j2 index 9cc2f58ab..9e6b4e82a 100644 --- a/roles/custom/matrix-bridge-mautrix-gmessages/templates/systemd/matrix-mautrix-gmessages.service.j2 +++ b/roles/custom/matrix-bridge-mautrix-gmessages/templates/systemd/matrix-mautrix-gmessages.service.j2 @@ -33,9 +33,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_mautrix_gmessages_container_image }} \ /usr/bin/mautrix-gmessages -c /config/config.yaml -r /config/registration.yaml --no-update +{% if matrix_mautrix_gmessages_container_network != 'host' %} {% for network in matrix_mautrix_gmessages_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mautrix-gmessages {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mautrix-gmessages diff --git a/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_install.yml index b572a8f34..6ba44f709 100644 --- a/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-googlechat/tasks/setup_install.yml @@ -133,6 +133,7 @@ register: matrix_mautrix_googlechat_support_files_result - name: Ensure matrix-mautrix-googlechat container network is created + when: matrix_mautrix_googlechat_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_googlechat_container_network }}" diff --git a/roles/custom/matrix-bridge-mautrix-googlechat/templates/systemd/matrix-mautrix-googlechat.service.j2 b/roles/custom/matrix-bridge-mautrix-googlechat/templates/systemd/matrix-mautrix-googlechat.service.j2 index 29c915d65..d616433bb 100644 --- a/roles/custom/matrix-bridge-mautrix-googlechat/templates/systemd/matrix-mautrix-googlechat.service.j2 +++ b/roles/custom/matrix-bridge-mautrix-googlechat/templates/systemd/matrix-mautrix-googlechat.service.j2 @@ -35,9 +35,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_mautrix_googlechat_container_image }} \ python3 -m mautrix_googlechat -c /config/config.yaml --no-update +{% if matrix_mautrix_googlechat_container_network != 'host' %} {% for network in matrix_mautrix_googlechat_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mautrix-googlechat {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mautrix-googlechat diff --git a/roles/custom/matrix-bridge-mautrix-meta-instagram/tasks/install.yml b/roles/custom/matrix-bridge-mautrix-meta-instagram/tasks/install.yml index 0e94edcf6..2ef0c9359 100644 --- a/roles/custom/matrix-bridge-mautrix-meta-instagram/tasks/install.yml +++ b/roles/custom/matrix-bridge-mautrix-meta-instagram/tasks/install.yml @@ -107,6 +107,7 @@ register: matrix_mautrix_meta_instagram_support_files_result - name: Ensure mautrix-meta-instagram container network is created + when: matrix_mautrix_meta_instagram_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_meta_instagram_container_network }}" diff --git a/roles/custom/matrix-bridge-mautrix-meta-instagram/templates/systemd/matrix-mautrix-meta.service.j2 b/roles/custom/matrix-bridge-mautrix-meta-instagram/templates/systemd/matrix-mautrix-meta.service.j2 index e9fc2eccb..5cecc659c 100644 --- a/roles/custom/matrix-bridge-mautrix-meta-instagram/templates/systemd/matrix-mautrix-meta.service.j2 +++ b/roles/custom/matrix-bridge-mautrix-meta-instagram/templates/systemd/matrix-mautrix-meta.service.j2 @@ -35,9 +35,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_mautrix_meta_instagram_container_image }} \ /usr/bin/mautrix-meta -c /config/config.yaml -r /config/registration.yaml --no-update +{% if matrix_mautrix_meta_instagram_container_network != 'host' %} {% for network in matrix_mautrix_meta_instagram_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} {{ matrix_mautrix_meta_instagram_identifier }} {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach {{ matrix_mautrix_meta_instagram_identifier }} diff --git a/roles/custom/matrix-bridge-mautrix-meta-messenger/tasks/install.yml b/roles/custom/matrix-bridge-mautrix-meta-messenger/tasks/install.yml index 0777e9a3d..b4b1e8f14 100644 --- a/roles/custom/matrix-bridge-mautrix-meta-messenger/tasks/install.yml +++ b/roles/custom/matrix-bridge-mautrix-meta-messenger/tasks/install.yml @@ -107,6 +107,7 @@ register: matrix_mautrix_meta_messenger_support_files_result - name: Ensure mautrix-meta-messenger container network is created + when: matrix_mautrix_meta_messenger_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_meta_messenger_container_network }}" diff --git a/roles/custom/matrix-bridge-mautrix-meta-messenger/templates/systemd/matrix-mautrix-meta.service.j2 b/roles/custom/matrix-bridge-mautrix-meta-messenger/templates/systemd/matrix-mautrix-meta.service.j2 index adf8a9c4e..7d5bbbdef 100644 --- a/roles/custom/matrix-bridge-mautrix-meta-messenger/templates/systemd/matrix-mautrix-meta.service.j2 +++ b/roles/custom/matrix-bridge-mautrix-meta-messenger/templates/systemd/matrix-mautrix-meta.service.j2 @@ -35,9 +35,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_mautrix_meta_messenger_container_image }} \ /usr/bin/mautrix-meta -c /config/config.yaml -r /config/registration.yaml --no-update +{% if matrix_mautrix_meta_messenger_container_network != 'host' %} {% for network in matrix_mautrix_meta_messenger_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} {{ matrix_mautrix_meta_messenger_identifier }} {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach {{ matrix_mautrix_meta_messenger_identifier }} diff --git a/roles/custom/matrix-bridge-mautrix-signal/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-signal/tasks/setup_install.yml index f40e00f3c..5d549bd1e 100644 --- a/roles/custom/matrix-bridge-mautrix-signal/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-signal/tasks/setup_install.yml @@ -148,6 +148,7 @@ register: matrix_mautrix_signal_support_files_result - name: Ensure matrix-mautrix-signal container network is created + when: matrix_mautrix_signal_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_signal_container_network }}" diff --git a/roles/custom/matrix-bridge-mautrix-signal/templates/systemd/matrix-mautrix-signal.service.j2 b/roles/custom/matrix-bridge-mautrix-signal/templates/systemd/matrix-mautrix-signal.service.j2 index cb6655bcc..4587ad170 100644 --- a/roles/custom/matrix-bridge-mautrix-signal/templates/systemd/matrix-mautrix-signal.service.j2 +++ b/roles/custom/matrix-bridge-mautrix-signal/templates/systemd/matrix-mautrix-signal.service.j2 @@ -33,9 +33,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_mautrix_signal_container_image }} \ /usr/bin/mautrix-signal -c /config/config.yaml -r /config/registration.yaml --no-update +{% if matrix_mautrix_signal_container_network != 'host' %} {% for network in matrix_mautrix_signal_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mautrix-signal {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mautrix-signal diff --git a/roles/custom/matrix-bridge-mautrix-slack/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-slack/tasks/setup_install.yml index 35deb7e8c..f6e5a4bc9 100644 --- a/roles/custom/matrix-bridge-mautrix-slack/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-slack/tasks/setup_install.yml @@ -98,6 +98,7 @@ register: matrix_mautrix_slack_registration_result - name: Ensure matrix-mautrix-slack container network is created + when: matrix_mautrix_slack_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_slack_container_network }}" diff --git a/roles/custom/matrix-bridge-mautrix-slack/templates/systemd/matrix-mautrix-slack.service.j2 b/roles/custom/matrix-bridge-mautrix-slack/templates/systemd/matrix-mautrix-slack.service.j2 index 200adc7f2..9b5231480 100644 --- a/roles/custom/matrix-bridge-mautrix-slack/templates/systemd/matrix-mautrix-slack.service.j2 +++ b/roles/custom/matrix-bridge-mautrix-slack/templates/systemd/matrix-mautrix-slack.service.j2 @@ -32,9 +32,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_mautrix_slack_container_image }} \ /usr/bin/mautrix-slack -c /config/config.yaml -r /config/registration.yaml --no-update +{% if matrix_mautrix_slack_container_network != 'host' %} {% for network in matrix_mautrix_slack_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mautrix-slack {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mautrix-slack diff --git a/roles/custom/matrix-bridge-mautrix-telegram/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-telegram/tasks/setup_install.yml index 0f902ef20..19722a59d 100644 --- a/roles/custom/matrix-bridge-mautrix-telegram/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-telegram/tasks/setup_install.yml @@ -154,6 +154,7 @@ register: matrix_mautrix_telegram_support_files_result - name: Ensure matrix-mautrix-telegram container network is created + when: matrix_mautrix_telegram_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_telegram_container_network }}" diff --git a/roles/custom/matrix-bridge-mautrix-telegram/templates/systemd/matrix-mautrix-telegram.service.j2 b/roles/custom/matrix-bridge-mautrix-telegram/templates/systemd/matrix-mautrix-telegram.service.j2 index 114267b0d..978d2db69 100644 --- a/roles/custom/matrix-bridge-mautrix-telegram/templates/systemd/matrix-mautrix-telegram.service.j2 +++ b/roles/custom/matrix-bridge-mautrix-telegram/templates/systemd/matrix-mautrix-telegram.service.j2 @@ -33,9 +33,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_mautrix_telegram_container_image }} \ /usr/bin/mautrix-telegram -c /config/config.yaml -r /config/registration.yaml --no-update +{% if matrix_mautrix_telegram_container_network != 'host' %} {% for network in matrix_mautrix_telegram_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mautrix-telegram {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mautrix-telegram diff --git a/roles/custom/matrix-bridge-mautrix-twitter/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-twitter/tasks/setup_install.yml index 868a5d8fa..8db0b6834 100644 --- a/roles/custom/matrix-bridge-mautrix-twitter/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-twitter/tasks/setup_install.yml @@ -88,6 +88,7 @@ register: matrix_mautrix_twitter_support_files_result - name: Ensure matrix-mautrix-twitter container network is created + when: matrix_mautrix_twitter_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_twitter_container_network }}" diff --git a/roles/custom/matrix-bridge-mautrix-twitter/templates/systemd/matrix-mautrix-twitter.service.j2 b/roles/custom/matrix-bridge-mautrix-twitter/templates/systemd/matrix-mautrix-twitter.service.j2 index c1ef8dc81..bb61402c6 100644 --- a/roles/custom/matrix-bridge-mautrix-twitter/templates/systemd/matrix-mautrix-twitter.service.j2 +++ b/roles/custom/matrix-bridge-mautrix-twitter/templates/systemd/matrix-mautrix-twitter.service.j2 @@ -32,9 +32,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_mautrix_twitter_container_image }} \ /usr/bin/mautrix-twitter -c /config/config.yaml -r /config/registration.yaml --no-update +{% if matrix_mautrix_twitter_container_network != 'host' %} {% for network in matrix_mautrix_twitter_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mautrix-twitter {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mautrix-twitter diff --git a/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/setup_install.yml index ce212a971..fd39ddfd7 100644 --- a/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-whatsapp/tasks/setup_install.yml @@ -153,6 +153,7 @@ register: matrix_mautrix_whatsapp_support_files_result - name: Ensure matrix-mautrix-whatsapp container network is created + when: matrix_mautrix_whatsapp_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_whatsapp_container_network }}" diff --git a/roles/custom/matrix-bridge-mautrix-whatsapp/templates/systemd/matrix-mautrix-whatsapp.service.j2 b/roles/custom/matrix-bridge-mautrix-whatsapp/templates/systemd/matrix-mautrix-whatsapp.service.j2 index e659cf7ae..cd1924c81 100644 --- a/roles/custom/matrix-bridge-mautrix-whatsapp/templates/systemd/matrix-mautrix-whatsapp.service.j2 +++ b/roles/custom/matrix-bridge-mautrix-whatsapp/templates/systemd/matrix-mautrix-whatsapp.service.j2 @@ -33,9 +33,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_mautrix_whatsapp_container_image }} \ /usr/bin/mautrix-whatsapp -c /config/config.yaml -r /config/registration.yaml --no-update +{% if matrix_mautrix_whatsapp_container_network != 'host' %} {% for network in matrix_mautrix_whatsapp_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mautrix-whatsapp {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mautrix-whatsapp diff --git a/roles/custom/matrix-bridge-mautrix-wsproxy/tasks/setup_install.yml b/roles/custom/matrix-bridge-mautrix-wsproxy/tasks/setup_install.yml index 9220c92c3..94e61a3b7 100644 --- a/roles/custom/matrix-bridge-mautrix-wsproxy/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mautrix-wsproxy/tasks/setup_install.yml @@ -107,6 +107,7 @@ register: matrix_mautrix_wsproxy_registration_imessage_result - name: Ensure mautrix-wsproxy container network is created + when: matrix_mautrix_wsproxy_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mautrix_wsproxy_container_network }}" diff --git a/roles/custom/matrix-bridge-mautrix-wsproxy/templates/systemd/matrix-mautrix-wsproxy-syncproxy.service.j2 b/roles/custom/matrix-bridge-mautrix-wsproxy/templates/systemd/matrix-mautrix-wsproxy-syncproxy.service.j2 index 0f0aa3768..54673bd9b 100644 --- a/roles/custom/matrix-bridge-mautrix-wsproxy/templates/systemd/matrix-mautrix-wsproxy-syncproxy.service.j2 +++ b/roles/custom/matrix-bridge-mautrix-wsproxy/templates/systemd/matrix-mautrix-wsproxy-syncproxy.service.j2 @@ -29,9 +29,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_mautrix_wsproxy_syncproxy_container_image }} +{% if matrix_mautrix_wsproxy_container_network != 'host' %} {% for network in matrix_mautrix_wsproxy_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mautrix-wsproxy-syncproxy {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mautrix-wsproxy-syncproxy diff --git a/roles/custom/matrix-bridge-mautrix-wsproxy/templates/systemd/matrix-mautrix-wsproxy.service.j2 b/roles/custom/matrix-bridge-mautrix-wsproxy/templates/systemd/matrix-mautrix-wsproxy.service.j2 index ca0e102da..fb5707414 100644 --- a/roles/custom/matrix-bridge-mautrix-wsproxy/templates/systemd/matrix-mautrix-wsproxy.service.j2 +++ b/roles/custom/matrix-bridge-mautrix-wsproxy/templates/systemd/matrix-mautrix-wsproxy.service.j2 @@ -32,9 +32,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create --rm - {{ matrix_mautrix_wsproxy_container_image }} \ /usr/bin/mautrix-wsproxy -config /data/config.yaml +{% if matrix_mautrix_wsproxy_container_network != 'host' %} {% for network in matrix_mautrix_wsproxy_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mautrix-wsproxy {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mautrix-wsproxy diff --git a/roles/custom/matrix-bridge-meshtastic-relay/tasks/setup_install.yml b/roles/custom/matrix-bridge-meshtastic-relay/tasks/setup_install.yml index 95721f983..0237dd305 100644 --- a/roles/custom/matrix-bridge-meshtastic-relay/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-meshtastic-relay/tasks/setup_install.yml @@ -36,12 +36,14 @@ register: matrix_meshtastic_relay_config_result - name: Ensure matrix-meshtastic-relay container network is created + when: + - matrix_meshtastic_relay_connection_type != 'ble' + - matrix_meshtastic_relay_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_meshtastic_relay_container_network }}" driver: bridge driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - when: "matrix_meshtastic_relay_connection_type != 'ble'" - name: Ensure matrix-meshtastic-relay.service installed ansible.builtin.template: diff --git a/roles/custom/matrix-bridge-meshtastic-relay/templates/systemd/matrix-meshtastic-relay.service.j2 b/roles/custom/matrix-bridge-meshtastic-relay/templates/systemd/matrix-meshtastic-relay.service.j2 index 83192a6df..739e72c2f 100644 --- a/roles/custom/matrix-bridge-meshtastic-relay/templates/systemd/matrix-meshtastic-relay.service.j2 +++ b/roles/custom/matrix-bridge-meshtastic-relay/templates/systemd/matrix-meshtastic-relay.service.j2 @@ -43,9 +43,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_meshtastic_relay_container_image }} \ mmrelay --config /config/config.yaml +{% if matrix_meshtastic_relay_container_network != 'host' %} {% for network in matrix_meshtastic_relay_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-meshtastic-relay {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-meshtastic-relay diff --git a/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/setup_install.yml b/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/setup_install.yml index 44edda784..e360cb8bf 100644 --- a/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mx-puppet-groupme/tasks/setup_install.yml @@ -122,6 +122,7 @@ register: matrix_mx_puppet_groupme_registration_result - name: Ensure mx-puppet-groupme container network is created + when: matrix_mx_puppet_groupme_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mx_puppet_groupme_container_network }}" diff --git a/roles/custom/matrix-bridge-mx-puppet-groupme/templates/systemd/matrix-mx-puppet-groupme.service.j2 b/roles/custom/matrix-bridge-mx-puppet-groupme/templates/systemd/matrix-mx-puppet-groupme.service.j2 index bc57467b8..c1cdc74a4 100644 --- a/roles/custom/matrix-bridge-mx-puppet-groupme/templates/systemd/matrix-mx-puppet-groupme.service.j2 +++ b/roles/custom/matrix-bridge-mx-puppet-groupme/templates/systemd/matrix-mx-puppet-groupme.service.j2 @@ -32,9 +32,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_mx_puppet_groupme_container_image }} +{% if matrix_mx_puppet_groupme_container_network != 'host' %} {% for network in matrix_mx_puppet_groupme_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mx-puppet-groupme {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mx-puppet-groupme diff --git a/roles/custom/matrix-bridge-mx-puppet-steam/tasks/setup_install.yml b/roles/custom/matrix-bridge-mx-puppet-steam/tasks/setup_install.yml index 74febe27b..36e829b64 100644 --- a/roles/custom/matrix-bridge-mx-puppet-steam/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-mx-puppet-steam/tasks/setup_install.yml @@ -124,6 +124,7 @@ register: matrix_mx_puppet_steam_registration_result - name: Ensure mx-puppet-steam container network is created + when: matrix_mx_puppet_steam_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_mx_puppet_steam_container_network }}" diff --git a/roles/custom/matrix-bridge-mx-puppet-steam/templates/systemd/matrix-mx-puppet-steam.service.j2 b/roles/custom/matrix-bridge-mx-puppet-steam/templates/systemd/matrix-mx-puppet-steam.service.j2 index ade6c21db..49e374492 100644 --- a/roles/custom/matrix-bridge-mx-puppet-steam/templates/systemd/matrix-mx-puppet-steam.service.j2 +++ b/roles/custom/matrix-bridge-mx-puppet-steam/templates/systemd/matrix-mx-puppet-steam.service.j2 @@ -32,9 +32,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_mx_puppet_steam_container_image }} +{% if matrix_mx_puppet_steam_container_network != 'host' %} {% for network in matrix_mx_puppet_steam_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mx-puppet-steam {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mx-puppet-steam diff --git a/roles/custom/matrix-bridge-postmoogle/tasks/setup_install.yml b/roles/custom/matrix-bridge-postmoogle/tasks/setup_install.yml index f44bedc3f..1dcdeb91d 100644 --- a/roles/custom/matrix-bridge-postmoogle/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-postmoogle/tasks/setup_install.yml @@ -110,6 +110,7 @@ register: matrix_postmoogle_container_image_build_result - name: Ensure postmoogle container network is created + when: matrix_postmoogle_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_postmoogle_container_network }}" diff --git a/roles/custom/matrix-bridge-postmoogle/templates/systemd/matrix-postmoogle.service.j2 b/roles/custom/matrix-bridge-postmoogle/templates/systemd/matrix-postmoogle.service.j2 index 9415382d1..80ebb5608 100644 --- a/roles/custom/matrix-bridge-postmoogle/templates/systemd/matrix-postmoogle.service.j2 +++ b/roles/custom/matrix-bridge-postmoogle/templates/systemd/matrix-postmoogle.service.j2 @@ -38,9 +38,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_postmoogle_container_image }} +{% if matrix_postmoogle_container_network != 'host' %} {% for network in matrix_postmoogle_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-postmoogle {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-postmoogle diff --git a/roles/custom/matrix-bridge-sms/tasks/setup_install.yml b/roles/custom/matrix-bridge-sms/tasks/setup_install.yml index b4ff93f86..b3470466b 100644 --- a/roles/custom/matrix-bridge-sms/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-sms/tasks/setup_install.yml @@ -60,6 +60,7 @@ register: matrix_sms_bridge_cert_result - name: Ensure matrix-sms-bridge container network is created + when: matrix_sms_bridge_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_sms_bridge_container_network }}" diff --git a/roles/custom/matrix-bridge-sms/templates/systemd/matrix-sms-bridge.service.j2 b/roles/custom/matrix-bridge-sms/templates/systemd/matrix-sms-bridge.service.j2 index 87218d266..69f2017c8 100644 --- a/roles/custom/matrix-bridge-sms/templates/systemd/matrix-sms-bridge.service.j2 +++ b/roles/custom/matrix-bridge-sms/templates/systemd/matrix-sms-bridge.service.j2 @@ -34,9 +34,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_sms_bridge_container_image }} +{% if matrix_sms_bridge_container_network != 'host' %} {% for network in matrix_sms_bridge_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-sms-bridge {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-sms-bridge diff --git a/roles/custom/matrix-bridge-steam/tasks/setup_install.yml b/roles/custom/matrix-bridge-steam/tasks/setup_install.yml index f2df6f170..a4312e442 100644 --- a/roles/custom/matrix-bridge-steam/tasks/setup_install.yml +++ b/roles/custom/matrix-bridge-steam/tasks/setup_install.yml @@ -82,6 +82,7 @@ register: matrix_steam_bridge_support_files_result - name: Ensure matrix-steam-bridge container network is created + when: matrix_steam_bridge_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_steam_bridge_container_network }}" diff --git a/roles/custom/matrix-bridge-steam/templates/systemd/matrix-steam-bridge.service.j2 b/roles/custom/matrix-bridge-steam/templates/systemd/matrix-steam-bridge.service.j2 index adfc9db9a..b711101ce 100644 --- a/roles/custom/matrix-bridge-steam/templates/systemd/matrix-steam-bridge.service.j2 +++ b/roles/custom/matrix-bridge-steam/templates/systemd/matrix-steam-bridge.service.j2 @@ -32,9 +32,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_steam_bridge_container_image }} \ /usr/bin/steam -c /app/config/config.yaml -r /app/config/registration.yaml --no-update +{% if matrix_steam_bridge_container_network != 'host' %} {% for network in matrix_steam_bridge_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-steam-bridge {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-steam-bridge diff --git a/roles/custom/matrix-bridge-wechat/tasks/install.yml b/roles/custom/matrix-bridge-wechat/tasks/install.yml index cbfe0d515..8ef3ae136 100644 --- a/roles/custom/matrix-bridge-wechat/tasks/install.yml +++ b/roles/custom/matrix-bridge-wechat/tasks/install.yml @@ -110,6 +110,7 @@ register: matrix_wechat_agent_config_result - name: Ensure matrix-wechat container network is created + when: matrix_wechat_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_wechat_container_network }}" diff --git a/roles/custom/matrix-bridge-wechat/templates/systemd/matrix-wechat-agent.service.j2 b/roles/custom/matrix-bridge-wechat/templates/systemd/matrix-wechat-agent.service.j2 index 9f9a195c2..4d51bdcec 100644 --- a/roles/custom/matrix-bridge-wechat/templates/systemd/matrix-wechat-agent.service.j2 +++ b/roles/custom/matrix-bridge-wechat/templates/systemd/matrix-wechat-agent.service.j2 @@ -33,9 +33,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_wechat_agent_container_image }} +{% if matrix_wechat_container_network != 'host' %} {% for network in matrix_wechat_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-wechat-agent {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-wechat-agent diff --git a/roles/custom/matrix-bridge-wechat/templates/systemd/matrix-wechat.service.j2 b/roles/custom/matrix-bridge-wechat/templates/systemd/matrix-wechat.service.j2 index 4c9deb056..d3e6b972d 100644 --- a/roles/custom/matrix-bridge-wechat/templates/systemd/matrix-wechat.service.j2 +++ b/roles/custom/matrix-bridge-wechat/templates/systemd/matrix-wechat.service.j2 @@ -31,9 +31,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_wechat_container_image }} \ /usr/bin/matrix-wechat -c /config/config.yaml -r /config/registration.yaml --no-update +{% if matrix_wechat_container_network != 'host' %} {% for network in matrix_wechat_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-wechat {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-wechat diff --git a/roles/custom/matrix-cactus-comments-client/tasks/install.yml b/roles/custom/matrix-cactus-comments-client/tasks/install.yml index 0e4e661e1..f7caca0cc 100644 --- a/roles/custom/matrix-cactus-comments-client/tasks/install.yml +++ b/roles/custom/matrix-cactus-comments-client/tasks/install.yml @@ -76,6 +76,7 @@ until: matrix_cactus_comments_client_container_image_pull_result is not failed - name: Ensure matrix-cactus-comments-client container network is created + when: matrix_cactus_comments_client_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_cactus_comments_client_container_network }}" diff --git a/roles/custom/matrix-cactus-comments-client/templates/systemd/matrix-cactus-comments-client.service.j2 b/roles/custom/matrix-cactus-comments-client/templates/systemd/matrix-cactus-comments-client.service.j2 index 995ce5d6f..bb7601042 100755 --- a/roles/custom/matrix-cactus-comments-client/templates/systemd/matrix-cactus-comments-client.service.j2 +++ b/roles/custom/matrix-cactus-comments-client/templates/systemd/matrix-cactus-comments-client.service.j2 @@ -32,9 +32,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ --mount type=bind,src={{ matrix_cactus_comments_client_public_path }},dst=/var/public,ro \ {{ matrix_cactus_comments_client_container_image }} +{% if matrix_cactus_comments_client_container_network != 'host' %} {% for network in matrix_cactus_comments_client_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-cactus-comments-client {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-cactus-comments-client diff --git a/roles/custom/matrix-cactus-comments/templates/systemd/matrix-cactus-comments.service.j2 b/roles/custom/matrix-cactus-comments/templates/systemd/matrix-cactus-comments.service.j2 index 5d7cb201a..5db5accc9 100644 --- a/roles/custom/matrix-cactus-comments/templates/systemd/matrix-cactus-comments.service.j2 +++ b/roles/custom/matrix-cactus-comments/templates/systemd/matrix-cactus-comments.service.j2 @@ -28,9 +28,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ --network={{ matrix_cactus_comments_container_network }} \ {{ matrix_cactus_comments_container_image }} +{% if matrix_cactus_comments_container_network != 'host' %} {% for network in matrix_cactus_comments_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-cactus-comments {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-cactus-comments diff --git a/roles/custom/matrix-client-commet/tasks/setup_install.yml b/roles/custom/matrix-client-commet/tasks/setup_install.yml index e5900d7e6..0eec9001a 100644 --- a/roles/custom/matrix-client-commet/tasks/setup_install.yml +++ b/roles/custom/matrix-client-commet/tasks/setup_install.yml @@ -89,6 +89,7 @@ register: matrix_client_commet_support_files_result - name: Ensure Commet container network is created + when: matrix_client_commet_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_client_commet_container_network }}" diff --git a/roles/custom/matrix-client-commet/templates/systemd/matrix-client-commet.service.j2 b/roles/custom/matrix-client-commet/templates/systemd/matrix-client-commet.service.j2 index adf998351..afd4a4310 100644 --- a/roles/custom/matrix-client-commet/templates/systemd/matrix-client-commet.service.j2 +++ b/roles/custom/matrix-client-commet/templates/systemd/matrix-client-commet.service.j2 @@ -41,9 +41,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_client_commet_container_image }} +{% if matrix_client_commet_container_network != 'host' %} {% for network in matrix_client_commet_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-client-commet {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-client-commet diff --git a/roles/custom/matrix-client-element/tasks/setup_install.yml b/roles/custom/matrix-client-element/tasks/setup_install.yml index 642c63559..7ffd753fd 100644 --- a/roles/custom/matrix-client-element/tasks/setup_install.yml +++ b/roles/custom/matrix-client-element/tasks/setup_install.yml @@ -116,6 +116,7 @@ when: "item.src is none" - name: Ensure Element Web container network is created + when: matrix_client_element_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_client_element_container_network }}" diff --git a/roles/custom/matrix-client-element/templates/systemd/matrix-client-element.service.j2 b/roles/custom/matrix-client-element/templates/systemd/matrix-client-element.service.j2 index 77ffe3e03..063d3b624 100644 --- a/roles/custom/matrix-client-element/templates/systemd/matrix-client-element.service.j2 +++ b/roles/custom/matrix-client-element/templates/systemd/matrix-client-element.service.j2 @@ -52,9 +52,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_client_element_container_image }} +{% if matrix_client_element_container_network != 'host' %} {% for network in matrix_client_element_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-client-element {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-client-element diff --git a/roles/custom/matrix-client-fluffychat/tasks/setup_install.yml b/roles/custom/matrix-client-fluffychat/tasks/setup_install.yml index baf10263e..44791239f 100644 --- a/roles/custom/matrix-client-fluffychat/tasks/setup_install.yml +++ b/roles/custom/matrix-client-fluffychat/tasks/setup_install.yml @@ -62,6 +62,7 @@ register: matrix_client_fluffychat_config_result - name: Ensure FluffyChat Web container network is created + when: matrix_client_fluffychat_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_client_fluffychat_container_network }}" diff --git a/roles/custom/matrix-client-fluffychat/templates/systemd/matrix-client-fluffychat.service.j2 b/roles/custom/matrix-client-fluffychat/templates/systemd/matrix-client-fluffychat.service.j2 index 0dcb3126d..f5ee16627 100644 --- a/roles/custom/matrix-client-fluffychat/templates/systemd/matrix-client-fluffychat.service.j2 +++ b/roles/custom/matrix-client-fluffychat/templates/systemd/matrix-client-fluffychat.service.j2 @@ -32,9 +32,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_client_fluffychat_container_image }} +{% if matrix_client_fluffychat_container_network != 'host' %} {% for network in matrix_client_fluffychat_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-client-fluffychat {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-client-fluffychat diff --git a/roles/custom/matrix-client-schildichat/tasks/setup_install.yml b/roles/custom/matrix-client-schildichat/tasks/setup_install.yml index 9840f2b4a..d6de88274 100644 --- a/roles/custom/matrix-client-schildichat/tasks/setup_install.yml +++ b/roles/custom/matrix-client-schildichat/tasks/setup_install.yml @@ -107,6 +107,7 @@ when: "item.src is none" - name: Ensure SchildiChat Web container network is created + when: matrix_client_schildichat_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_client_schildichat_container_network }}" diff --git a/roles/custom/matrix-client-schildichat/templates/systemd/matrix-client-schildichat.service.j2 b/roles/custom/matrix-client-schildichat/templates/systemd/matrix-client-schildichat.service.j2 index 7afc7ac89..fdfefa8a4 100644 --- a/roles/custom/matrix-client-schildichat/templates/systemd/matrix-client-schildichat.service.j2 +++ b/roles/custom/matrix-client-schildichat/templates/systemd/matrix-client-schildichat.service.j2 @@ -40,9 +40,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_client_schildichat_container_image }} +{% if matrix_client_schildichat_container_network != 'host' %} {% for network in matrix_client_schildichat_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-client-schildichat {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-client-schildichat diff --git a/roles/custom/matrix-conduit/tasks/setup_install.yml b/roles/custom/matrix-conduit/tasks/setup_install.yml index cedf28a36..c204fbe59 100644 --- a/roles/custom/matrix-conduit/tasks/setup_install.yml +++ b/roles/custom/matrix-conduit/tasks/setup_install.yml @@ -45,6 +45,7 @@ register: matrix_conduit_support_files_result - name: Ensure Conduit container network is created + when: matrix_conduit_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_conduit_container_network }}" diff --git a/roles/custom/matrix-conduit/templates/systemd/matrix-conduit.service.j2 b/roles/custom/matrix-conduit/templates/systemd/matrix-conduit.service.j2 index 26df0065a..a8b76d610 100644 --- a/roles/custom/matrix-conduit/templates/systemd/matrix-conduit.service.j2 +++ b/roles/custom/matrix-conduit/templates/systemd/matrix-conduit.service.j2 @@ -30,9 +30,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_conduit_container_image }} +{% if matrix_conduit_container_network != 'host' %} {% for network in matrix_conduit_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-conduit {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-conduit diff --git a/roles/custom/matrix-continuwuity/tasks/install.yml b/roles/custom/matrix-continuwuity/tasks/install.yml index ce3b8aa48..8d5d6f04c 100644 --- a/roles/custom/matrix-continuwuity/tasks/install.yml +++ b/roles/custom/matrix-continuwuity/tasks/install.yml @@ -42,6 +42,7 @@ register: matrix_continuwuity_support_files_result - name: Ensure continuwuity container network is created + when: matrix_continuwuity_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_continuwuity_container_network }}" diff --git a/roles/custom/matrix-continuwuity/tasks/setup_install.yml b/roles/custom/matrix-continuwuity/tasks/setup_install.yml index c96c6e493..539ab5ce1 100644 --- a/roles/custom/matrix-continuwuity/tasks/setup_install.yml +++ b/roles/custom/matrix-continuwuity/tasks/setup_install.yml @@ -39,6 +39,7 @@ - labels - name: Ensure continuwuity container network is created + when: matrix_continuwuity_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_continuwuity_container_network }}" diff --git a/roles/custom/matrix-continuwuity/templates/systemd/matrix-continuwuity.service.j2 b/roles/custom/matrix-continuwuity/templates/systemd/matrix-continuwuity.service.j2 index 489a53264..da53c33be 100644 --- a/roles/custom/matrix-continuwuity/templates/systemd/matrix-continuwuity.service.j2 +++ b/roles/custom/matrix-continuwuity/templates/systemd/matrix-continuwuity.service.j2 @@ -34,9 +34,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_continuwuity_container_image }} +{% if matrix_continuwuity_container_network != 'host' %} {% for network in matrix_continuwuity_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-continuwuity {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-continuwuity diff --git a/roles/custom/matrix-corporal/tasks/setup_install.yml b/roles/custom/matrix-corporal/tasks/setup_install.yml index 0e51e3a6e..271089e85 100644 --- a/roles/custom/matrix-corporal/tasks/setup_install.yml +++ b/roles/custom/matrix-corporal/tasks/setup_install.yml @@ -76,6 +76,7 @@ register: matrix_corporal_support_files_result - name: Ensure Matrix Corporal container network is created + when: matrix_corporal_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_corporal_container_network }}" diff --git a/roles/custom/matrix-corporal/templates/systemd/matrix-corporal.service.j2 b/roles/custom/matrix-corporal/templates/systemd/matrix-corporal.service.j2 index f9d2eeff7..73cec888e 100644 --- a/roles/custom/matrix-corporal/templates/systemd/matrix-corporal.service.j2 +++ b/roles/custom/matrix-corporal/templates/systemd/matrix-corporal.service.j2 @@ -37,9 +37,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_corporal_container_image }} \ /matrix-corporal -config=/etc/matrix-corporal/config.json +{% if matrix_corporal_container_network != 'host' %} {% for network in matrix_corporal_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-corporal {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-corporal diff --git a/roles/custom/matrix-dendrite/tasks/setup_install.yml b/roles/custom/matrix-dendrite/tasks/setup_install.yml index d6f38c3d3..667a6f5b4 100644 --- a/roles/custom/matrix-dendrite/tasks/setup_install.yml +++ b/roles/custom/matrix-dendrite/tasks/setup_install.yml @@ -118,6 +118,7 @@ when: "matrix_dendrite_git_pull_results.changed | bool or matrix_dendrite_container_image_check_result.stdout == ''" - name: Ensure Dendrite container network is created + when: matrix_dendrite_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_dendrite_container_network }}" diff --git a/roles/custom/matrix-dendrite/templates/systemd/matrix-dendrite.service.j2 b/roles/custom/matrix-dendrite/templates/systemd/matrix-dendrite.service.j2 index 31e485150..698ae0835 100644 --- a/roles/custom/matrix-dendrite/templates/systemd/matrix-dendrite.service.j2 +++ b/roles/custom/matrix-dendrite/templates/systemd/matrix-dendrite.service.j2 @@ -57,9 +57,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ -https-bind-address {{ matrix_dendrite_https_bind_address }} {% endif %} +{% if matrix_dendrite_container_network != 'host' %} {% for network in matrix_dendrite_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-dendrite {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-dendrite diff --git a/roles/custom/matrix-element-admin/tasks/install.yml b/roles/custom/matrix-element-admin/tasks/install.yml index 19e88dca0..5539807f7 100644 --- a/roles/custom/matrix-element-admin/tasks/install.yml +++ b/roles/custom/matrix-element-admin/tasks/install.yml @@ -63,6 +63,7 @@ changed_when: true - name: Ensure Element Admin container network is created + when: matrix_element_admin_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_element_admin_container_network }}" diff --git a/roles/custom/matrix-element-admin/templates/systemd/matrix-element-admin.service.j2 b/roles/custom/matrix-element-admin/templates/systemd/matrix-element-admin.service.j2 index 35e64d9e6..03511f8f5 100644 --- a/roles/custom/matrix-element-admin/templates/systemd/matrix-element-admin.service.j2 +++ b/roles/custom/matrix-element-admin/templates/systemd/matrix-element-admin.service.j2 @@ -35,9 +35,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_element_admin_container_image }} {{ matrix_element_admin_container_process_extra_arguments | join(' ') }} +{% if matrix_element_admin_container_network != 'host' %} {% for network in matrix_element_admin_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-element-admin {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-element-admin diff --git a/roles/custom/matrix-element-call/tasks/install.yml b/roles/custom/matrix-element-call/tasks/install.yml index 3c1983543..53bb51aec 100644 --- a/roles/custom/matrix-element-call/tasks/install.yml +++ b/roles/custom/matrix-element-call/tasks/install.yml @@ -44,6 +44,7 @@ until: matrix_element_call_container_image_pull_result is not failed - name: Ensure Element Call container network is created + when: matrix_element_call_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_element_call_container_network }}" diff --git a/roles/custom/matrix-element-call/templates/systemd/matrix-element-call.service.j2 b/roles/custom/matrix-element-call/templates/systemd/matrix-element-call.service.j2 index fbfe3b446..13794f7bb 100644 --- a/roles/custom/matrix-element-call/templates/systemd/matrix-element-call.service.j2 +++ b/roles/custom/matrix-element-call/templates/systemd/matrix-element-call.service.j2 @@ -30,9 +30,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_element_call_container_image }} +{% if matrix_element_call_container_network != 'host' %} {% for network in matrix_element_call_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-element-call {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-element-call diff --git a/roles/custom/matrix-ketesa/tasks/setup_install.yml b/roles/custom/matrix-ketesa/tasks/setup_install.yml index ac6970862..e112e0cc2 100644 --- a/roles/custom/matrix-ketesa/tasks/setup_install.yml +++ b/roles/custom/matrix-ketesa/tasks/setup_install.yml @@ -102,6 +102,7 @@ register: matrix_ketesa_container_image_build_result - name: Ensure matrix-ketesa container network is created + when: matrix_ketesa_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_ketesa_container_network }}" diff --git a/roles/custom/matrix-ketesa/templates/systemd/matrix-ketesa.service.j2 b/roles/custom/matrix-ketesa/templates/systemd/matrix-ketesa.service.j2 index 2770f0079..809a7e1b7 100644 --- a/roles/custom/matrix-ketesa/templates/systemd/matrix-ketesa.service.j2 +++ b/roles/custom/matrix-ketesa/templates/systemd/matrix-ketesa.service.j2 @@ -34,9 +34,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_ketesa_container_image }} +{% if matrix_ketesa_container_network != 'host' %} {% for network in matrix_ketesa_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-ketesa {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-ketesa diff --git a/roles/custom/matrix-livekit-jwt-service/tasks/install.yml b/roles/custom/matrix-livekit-jwt-service/tasks/install.yml index d1d41f565..18e09891d 100644 --- a/roles/custom/matrix-livekit-jwt-service/tasks/install.yml +++ b/roles/custom/matrix-livekit-jwt-service/tasks/install.yml @@ -60,6 +60,7 @@ register: matrix_livekit_jwt_service_container_image_build_result - name: Ensure LiveKit JWT Service container network is created + when: matrix_livekit_jwt_service_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_livekit_jwt_service_container_network }}" diff --git a/roles/custom/matrix-livekit-jwt-service/templates/systemd/matrix-livekit-jwt-service.service.j2 b/roles/custom/matrix-livekit-jwt-service/templates/systemd/matrix-livekit-jwt-service.service.j2 index 1d22b8cce..e0a588348 100644 --- a/roles/custom/matrix-livekit-jwt-service/templates/systemd/matrix-livekit-jwt-service.service.j2 +++ b/roles/custom/matrix-livekit-jwt-service/templates/systemd/matrix-livekit-jwt-service.service.j2 @@ -26,9 +26,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ --label-file={{ matrix_livekit_jwt_service_base_path }}/labels \ {{ matrix_livekit_jwt_service_container_image }} +{% if matrix_livekit_jwt_service_container_network != 'host' %} {% for network in matrix_livekit_jwt_service_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-livekit-jwt-service {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-livekit-jwt-service diff --git a/roles/custom/matrix-matrixto/tasks/install.yml b/roles/custom/matrix-matrixto/tasks/install.yml index dfa1cdd4d..6abed3110 100644 --- a/roles/custom/matrix-matrixto/tasks/install.yml +++ b/roles/custom/matrix-matrixto/tasks/install.yml @@ -44,7 +44,9 @@ register: matrix_matrixto_container_image_build_result - name: Ensure Matrix.to container network is created via community.docker.docker_network - when: devture_systemd_docker_base_container_network_creation_method == 'ansible-module' + when: + - devture_systemd_docker_base_container_network_creation_method == 'ansible-module' + - matrix_matrixto_container_network != 'host' community.docker.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_matrixto_container_network }}" @@ -52,7 +54,9 @@ driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" - name: Ensure Matrix.to container network is created via ansible.builtin.command - when: devture_systemd_docker_base_container_network_creation_method == 'command' + when: + - devture_systemd_docker_base_container_network_creation_method == 'command' + - matrix_matrixto_container_network != 'host' ansible.builtin.command: cmd: >- {{ devture_systemd_docker_base_host_command_docker }} network create diff --git a/roles/custom/matrix-matrixto/templates/systemd/matrix-matrixto.service.j2 b/roles/custom/matrix-matrixto/templates/systemd/matrix-matrixto.service.j2 index 4d02857a5..a3849f9eb 100644 --- a/roles/custom/matrix-matrixto/templates/systemd/matrix-matrixto.service.j2 +++ b/roles/custom/matrix-matrixto/templates/systemd/matrix-matrixto.service.j2 @@ -42,9 +42,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_matrixto_container_image_self_build_name }} +{% if matrix_matrixto_container_network != 'host' %} {% for network in matrix_matrixto_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} {{ matrix_matrixto_identifier }} {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach {{ matrix_matrixto_identifier }} diff --git a/roles/custom/matrix-media-repo/tasks/setup_install.yml b/roles/custom/matrix-media-repo/tasks/setup_install.yml index 0a761e351..094bdf31e 100755 --- a/roles/custom/matrix-media-repo/tasks/setup_install.yml +++ b/roles/custom/matrix-media-repo/tasks/setup_install.yml @@ -142,6 +142,7 @@ removes: "{{ matrix_media_repo_config_path }}/{{ matrix_media_repo_identifier }}.signing.key.TEMP" - name: Ensure media-repo container network is created + when: matrix_media_repo_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_media_repo_container_network }}" diff --git a/roles/custom/matrix-media-repo/templates/media-repo/systemd/matrix-media-repo.service.j2 b/roles/custom/matrix-media-repo/templates/media-repo/systemd/matrix-media-repo.service.j2 index 8260d0bdd..cf0c605d4 100755 --- a/roles/custom/matrix-media-repo/templates/media-repo/systemd/matrix-media-repo.service.j2 +++ b/roles/custom/matrix-media-repo/templates/media-repo/systemd/matrix-media-repo.service.j2 @@ -40,9 +40,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_media_repo_container_image }} +{% if matrix_media_repo_container_network != 'host' %} {% for network in matrix_media_repo_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} {{ matrix_media_repo_identifier }} {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach {{ matrix_media_repo_identifier }} diff --git a/roles/custom/matrix-pantalaimon/tasks/install.yml b/roles/custom/matrix-pantalaimon/tasks/install.yml index dd8a709d7..8f19974be 100644 --- a/roles/custom/matrix-pantalaimon/tasks/install.yml +++ b/roles/custom/matrix-pantalaimon/tasks/install.yml @@ -59,6 +59,7 @@ register: matrix_pantalaimon_container_image_build_result - name: Ensure pantalaimon container network is created + when: matrix_pantalaimon_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_pantalaimon_container_network }}" diff --git a/roles/custom/matrix-pantalaimon/templates/systemd/matrix-pantalaimon.service.j2 b/roles/custom/matrix-pantalaimon/templates/systemd/matrix-pantalaimon.service.j2 index fb7d02c41..85fbe9d29 100644 --- a/roles/custom/matrix-pantalaimon/templates/systemd/matrix-pantalaimon.service.j2 +++ b/roles/custom/matrix-pantalaimon/templates/systemd/matrix-pantalaimon.service.j2 @@ -30,9 +30,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_pantalaimon_container_image }} +{% if matrix_pantalaimon_container_network != 'host' %} {% for network in matrix_pantalaimon_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-pantalaimon {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-pantalaimon diff --git a/roles/custom/matrix-rageshake/tasks/install.yml b/roles/custom/matrix-rageshake/tasks/install.yml index 123ed7a03..e2636066a 100644 --- a/roles/custom/matrix-rageshake/tasks/install.yml +++ b/roles/custom/matrix-rageshake/tasks/install.yml @@ -73,6 +73,7 @@ when: matrix_rageshake_container_image_self_build | bool - name: Ensure rageshake container network is created + when: matrix_rageshake_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_rageshake_container_network }}" diff --git a/roles/custom/matrix-rageshake/templates/systemd/matrix-rageshake.service.j2 b/roles/custom/matrix-rageshake/templates/systemd/matrix-rageshake.service.j2 index 68a0e9984..a90ecdb1e 100644 --- a/roles/custom/matrix-rageshake/templates/systemd/matrix-rageshake.service.j2 +++ b/roles/custom/matrix-rageshake/templates/systemd/matrix-rageshake.service.j2 @@ -34,9 +34,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_rageshake_container_image }} \ --config /config/config.yaml +{% if matrix_rageshake_container_network != 'host' %} {% for network in matrix_rageshake_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-rageshake {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-rageshake diff --git a/roles/custom/matrix-static-files/tasks/install.yml b/roles/custom/matrix-static-files/tasks/install.yml index 203a83787..52aa2b73e 100644 --- a/roles/custom/matrix-static-files/tasks/install.yml +++ b/roles/custom/matrix-static-files/tasks/install.yml @@ -94,6 +94,7 @@ until: matrix_static_files_container_image_pull_result is not failed - name: Ensure matrix-static-files container network is created + when: matrix_static_files_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_static_files_container_network }}" diff --git a/roles/custom/matrix-static-files/templates/systemd/matrix-static-files.service.j2 b/roles/custom/matrix-static-files/templates/systemd/matrix-static-files.service.j2 index 8f93ef0e2..759c4d8cf 100755 --- a/roles/custom/matrix-static-files/templates/systemd/matrix-static-files.service.j2 +++ b/roles/custom/matrix-static-files/templates/systemd/matrix-static-files.service.j2 @@ -33,9 +33,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ --mount type=bind,src={{ matrix_static_files_config_path }},dst=/config,ro \ {{ matrix_static_files_container_image }} +{% if matrix_static_files_container_network != 'host' %} {% for network in matrix_static_files_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-static-files {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-static-files diff --git a/roles/custom/matrix-sygnal/tasks/install.yml b/roles/custom/matrix-sygnal/tasks/install.yml index 0f2ec40b3..bca568ebc 100644 --- a/roles/custom/matrix-sygnal/tasks/install.yml +++ b/roles/custom/matrix-sygnal/tasks/install.yml @@ -49,6 +49,7 @@ until: matrix_sygnal_container_image_pull_result is not failed - name: Ensure Sygnal container network is created + when: matrix_sygnal_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_sygnal_container_network }}" diff --git a/roles/custom/matrix-sygnal/templates/systemd/matrix-sygnal.service.j2 b/roles/custom/matrix-sygnal/templates/systemd/matrix-sygnal.service.j2 index ef7c20d97..bea4e9c73 100644 --- a/roles/custom/matrix-sygnal/templates/systemd/matrix-sygnal.service.j2 +++ b/roles/custom/matrix-sygnal/templates/systemd/matrix-sygnal.service.j2 @@ -35,9 +35,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_sygnal_container_image }} +{% if matrix_sygnal_container_network != 'host' %} {% for network in matrix_sygnal_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-sygnal {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-sygnal diff --git a/roles/custom/matrix-synapse-auto-compressor/tasks/install.yml b/roles/custom/matrix-synapse-auto-compressor/tasks/install.yml index e8aaa839f..5fea7dc00 100644 --- a/roles/custom/matrix-synapse-auto-compressor/tasks/install.yml +++ b/roles/custom/matrix-synapse-auto-compressor/tasks/install.yml @@ -83,6 +83,7 @@ when: "matrix_synapse_auto_compressor_git_pull_results.changed | bool or matrix_synapse_auto_compressor_container_image_check_result.stdout == ''" - name: Ensure matrix-synapse-auto-compressor container network is created + when: matrix_synapse_auto_compressor_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_synapse_auto_compressor_container_network }}" diff --git a/roles/custom/matrix-synapse-auto-compressor/templates/matrix-synapse-auto-compressor.service.j2 b/roles/custom/matrix-synapse-auto-compressor/templates/matrix-synapse-auto-compressor.service.j2 index 07435ee37..b5a36cefe 100644 --- a/roles/custom/matrix-synapse-auto-compressor/templates/matrix-synapse-auto-compressor.service.j2 +++ b/roles/custom/matrix-synapse-auto-compressor/templates/matrix-synapse-auto-compressor.service.j2 @@ -33,9 +33,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_synapse_auto_compressor_container_image }} \ -c '{{ matrix_synapse_auto_compressor_command }}' +{% if matrix_synapse_auto_compressor_container_network != 'host' %} {% for network in matrix_synapse_auto_compressor_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-synapse-auto-compressor {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-synapse-auto-compressor diff --git a/roles/custom/matrix-synapse-usage-exporter/tasks/setup_install.yml b/roles/custom/matrix-synapse-usage-exporter/tasks/setup_install.yml index 7c7391a33..ba949861c 100644 --- a/roles/custom/matrix-synapse-usage-exporter/tasks/setup_install.yml +++ b/roles/custom/matrix-synapse-usage-exporter/tasks/setup_install.yml @@ -70,6 +70,7 @@ when: "matrix_synapse_usage_exporter_git_pull_results.changed | bool or matrix_synapse_usage_exporter_container_image_check_result.stdout == ''" - name: Ensure synapse-usage-exporter container network is created + when: matrix_synapse_usage_exporter_container_network != 'host' community.general.docker_network: name: "{{ matrix_synapse_usage_exporter_container_network }}" driver: bridge diff --git a/roles/custom/matrix-synapse-usage-exporter/templates/systemd/matrix-synapse-usage-exporter.service.j2 b/roles/custom/matrix-synapse-usage-exporter/templates/systemd/matrix-synapse-usage-exporter.service.j2 index ad4fc342e..6a3c8d68f 100644 --- a/roles/custom/matrix-synapse-usage-exporter/templates/systemd/matrix-synapse-usage-exporter.service.j2 +++ b/roles/custom/matrix-synapse-usage-exporter/templates/systemd/matrix-synapse-usage-exporter.service.j2 @@ -30,9 +30,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_synapse_usage_exporter_container_image }} +{% if matrix_synapse_usage_exporter_container_network != 'host' %} {% for network in matrix_synapse_usage_exporter_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} {{ matrix_synapse_usage_exporter_identifier }} {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach {{ matrix_synapse_usage_exporter_identifier }} diff --git a/roles/custom/matrix-synapse/tasks/reverse_proxy_companion/setup_install.yml b/roles/custom/matrix-synapse/tasks/reverse_proxy_companion/setup_install.yml index c42388ae2..ffefe8a5f 100644 --- a/roles/custom/matrix-synapse/tasks/reverse_proxy_companion/setup_install.yml +++ b/roles/custom/matrix-synapse/tasks/reverse_proxy_companion/setup_install.yml @@ -61,6 +61,7 @@ until: matrix_synapse_reverse_proxy_companion_container_image_pull_result is not failed - name: Ensure matrix-synapse-reverse-proxy-companion container network is created + when: matrix_synapse_reverse_proxy_companion_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_synapse_reverse_proxy_companion_container_network }}" diff --git a/roles/custom/matrix-synapse/tasks/synapse/setup_install.yml b/roles/custom/matrix-synapse/tasks/synapse/setup_install.yml index fa56df5e1..c0cdae581 100644 --- a/roles/custom/matrix-synapse/tasks/synapse/setup_install.yml +++ b/roles/custom/matrix-synapse/tasks/synapse/setup_install.yml @@ -129,6 +129,7 @@ group: "{{ matrix_synapse_gid }}" - name: Ensure Synapse container network is created + when: matrix_synapse_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_synapse_container_network }}" diff --git a/roles/custom/matrix-synapse/templates/reverse_proxy_companion/systemd/matrix-synapse-reverse-proxy-companion.service.j2 b/roles/custom/matrix-synapse/templates/reverse_proxy_companion/systemd/matrix-synapse-reverse-proxy-companion.service.j2 index 2f0aff36f..6a47dbf8f 100755 --- a/roles/custom/matrix-synapse/templates/reverse_proxy_companion/systemd/matrix-synapse-reverse-proxy-companion.service.j2 +++ b/roles/custom/matrix-synapse/templates/reverse_proxy_companion/systemd/matrix-synapse-reverse-proxy-companion.service.j2 @@ -45,9 +45,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_synapse_reverse_proxy_companion_container_image }} +{% if matrix_synapse_reverse_proxy_companion_container_network != 'host' %} {% for network in matrix_synapse_reverse_proxy_companion_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-synapse-reverse-proxy-companion {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-synapse-reverse-proxy-companion diff --git a/roles/custom/matrix-synapse/templates/synapse/systemd/matrix-synapse-worker.service.j2 b/roles/custom/matrix-synapse/templates/synapse/systemd/matrix-synapse-worker.service.j2 index d75473f37..1ff0e9606 100644 --- a/roles/custom/matrix-synapse/templates/synapse/systemd/matrix-synapse-worker.service.j2 +++ b/roles/custom/matrix-synapse/templates/synapse/systemd/matrix-synapse-worker.service.j2 @@ -83,9 +83,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_synapse_container_image_final }} \ run -m synapse.app.{{ matrix_synapse_worker_details.app }} -c /data/homeserver.yaml -c /data/{{ matrix_synapse_worker_config_file_name }} +{% if matrix_synapse_container_network != 'host' %} {% for network in matrix_synapse_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} {{ matrix_synapse_worker_container_name }} {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach {{ matrix_synapse_worker_container_name }} diff --git a/roles/custom/matrix-synapse/templates/synapse/systemd/matrix-synapse.service.j2 b/roles/custom/matrix-synapse/templates/synapse/systemd/matrix-synapse.service.j2 index 1516a718a..ecedbaecf 100644 --- a/roles/custom/matrix-synapse/templates/synapse/systemd/matrix-synapse.service.j2 +++ b/roles/custom/matrix-synapse/templates/synapse/systemd/matrix-synapse.service.j2 @@ -70,9 +70,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {{ matrix_synapse_container_image_final }} \ run -m synapse.app.homeserver -c /data/homeserver.yaml +{% if matrix_synapse_container_network != 'host' %} {% for network in matrix_synapse_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-synapse {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-synapse diff --git a/roles/custom/matrix-tuwunel/tasks/install.yml b/roles/custom/matrix-tuwunel/tasks/install.yml index 08b7f56e5..4068f67d8 100644 --- a/roles/custom/matrix-tuwunel/tasks/install.yml +++ b/roles/custom/matrix-tuwunel/tasks/install.yml @@ -43,6 +43,7 @@ register: matrix_tuwunel_support_files_result - name: Ensure tuwunel container network is created + when: matrix_tuwunel_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_tuwunel_container_network }}" diff --git a/roles/custom/matrix-tuwunel/templates/systemd/matrix-tuwunel.service.j2 b/roles/custom/matrix-tuwunel/templates/systemd/matrix-tuwunel.service.j2 index 6d1db04f2..05af8f7ab 100644 --- a/roles/custom/matrix-tuwunel/templates/systemd/matrix-tuwunel.service.j2 +++ b/roles/custom/matrix-tuwunel/templates/systemd/matrix-tuwunel.service.j2 @@ -34,9 +34,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_tuwunel_container_image }} +{% if matrix_tuwunel_container_network != 'host' %} {% for network in matrix_tuwunel_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-tuwunel {% endfor %} +{% endif %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-tuwunel diff --git a/roles/custom/matrix-user-verification-service/tasks/setup_install.yml b/roles/custom/matrix-user-verification-service/tasks/setup_install.yml index 6d6646579..ca810c3cd 100644 --- a/roles/custom/matrix-user-verification-service/tasks/setup_install.yml +++ b/roles/custom/matrix-user-verification-service/tasks/setup_install.yml @@ -59,6 +59,7 @@ register: matrix_user_verification_service_config_result - name: Ensure matrix-user-verification-service container network is created + when: matrix_user_verification_service_container_network != 'host' community.general.docker_network: enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" name: "{{ matrix_user_verification_service_container_network }}" diff --git a/roles/custom/matrix-user-verification-service/templates/systemd/matrix-user-verification-service.service.j2 b/roles/custom/matrix-user-verification-service/templates/systemd/matrix-user-verification-service.service.j2 index a75f489e9..4be4b6446 100644 --- a/roles/custom/matrix-user-verification-service/templates/systemd/matrix-user-verification-service.service.j2 +++ b/roles/custom/matrix-user-verification-service/templates/systemd/matrix-user-verification-service.service.j2 @@ -35,9 +35,11 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ {% endfor %} {{ matrix_user_verification_service_container_image }} +{% if matrix_user_verification_service_container_network != 'host' %} {% for network in matrix_user_verification_service_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} {{ matrix_user_verification_service_container_name }} {% endfor %} +{% endif %} ExecStart=/usr/bin/env docker start --attach matrix-user-verification-service ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} {{ matrix_user_verification_service_container_name }} 2>/dev/null'