Add additional-networks support to matrix-dynamic-dns

Not that it seems necessary right now, but it makes it consistent with
all other roles.
This commit is contained in:
Slavi Pantaleev 2024-01-15 11:17:57 +02:00
parent ad32953e0b
commit 92c3122b96
2 changed files with 15 additions and 1 deletions

View File

@ -20,6 +20,10 @@ matrix_dynamic_dns_docker_image_force_pull: "{{ matrix_dynamic_dns_docker_image.
matrix_dynamic_dns_container_network: '' matrix_dynamic_dns_container_network: ''
matrix_dynamic_dns_container_additional_networks: "{{ matrix_dynamic_dns_container_additional_networks_auto + matrix_dynamic_dns_container_additional_networks_custom }}"
matrix_dynamic_dns_container_additional_networks_auto: []
matrix_dynamic_dns_container_additional_networks_custom: []
# List of extra arguments to pass to the ontainer mode # List of extra arguments to pass to the ontainer mode
matrix_dynamic_dns_container_extra_arguments: [] matrix_dynamic_dns_container_extra_arguments: []

View File

@ -15,7 +15,10 @@ Type=simple
Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}" Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-dynamic-dns 2>/dev/null || true' ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-dynamic-dns 2>/dev/null || true'
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-dynamic-dns 2>/dev/null || true' ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-dynamic-dns 2>/dev/null || true'
ExecStart={{ devture_systemd_docker_base_host_command_docker }} run --rm --name matrix-dynamic-dns \
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
--rm \
--name=matrix-dynamic-dns \
--log-driver=none \ --log-driver=none \
--network={{ matrix_dynamic_dns_container_network }} \ --network={{ matrix_dynamic_dns_container_network }} \
-e PUID={{ matrix_user_uid }} \ -e PUID={{ matrix_user_uid }} \
@ -26,6 +29,13 @@ ExecStart={{ devture_systemd_docker_base_host_command_docker }} run --rm --name
{% endfor %} {% endfor %}
{{ matrix_dynamic_dns_docker_image }} {{ matrix_dynamic_dns_docker_image }}
{% for network in matrix_dynamic_dns_container_additional_networks %}
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-dynamic-dns
{% endfor %}
ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-dynamic-dns
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-dynamic-dns 2>/dev/null || true' ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-dynamic-dns 2>/dev/null || true'
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-dynamic-dns 2>/dev/null || true' ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-dynamic-dns 2>/dev/null || true'
Restart=always Restart=always