service: Imrove native sockets

This commit is contained in:
uumas
2026-03-12 00:34:25 +02:00
parent 294b931d19
commit efc7bf5434
3 changed files with 4 additions and 5 deletions

View File

@@ -29,9 +29,7 @@ argument_specs:
service_container_http_port: service_container_http_port:
description: description:
- Port inside the container where http requests are proxied to. - Port inside the container where http requests are proxied to.
- >- - If set to 0, http requests are proxied to /run/<service name>.sock inside the container
If set to 0, /run/{{ service_name }}.sock on the host is bind mounted to /run/{{ service_name }}.sock inside the container
and http requests are proxied to it.
type: int type: int
required: false required: false
default: 0 default: 0

View File

@@ -1,6 +1,7 @@
# {{ ansible_managed }} # {{ ansible_managed }}
[Unit] [Unit]
Description={{ service_name }} socket Description={{ service_name }} socket
Requires={{ service_name }}.service
[Socket] [Socket]
ListenStream=/run/{{ service_name }}.sock ListenStream=/run/{{ service_name }}.sock

View File

@@ -1,8 +1,8 @@
--- ---
_service_container_socket_mount: _service_container_socket_mount:
type: bind type: bind
source: /run/{{ service_name }} source: /run/{{ service_name }}.sock
destination: /run/{{ service_name }} destination: /run/{{ service_name }}.sock
_service_volume_mounts: "{{ service_container_mounts | selectattr('type', '==', 'volume') }}" _service_volume_mounts: "{{ service_container_mounts | selectattr('type', '==', 'volume') }}"
_service_template_mounts: "{{ service_container_mounts | selectattr('type', '==', 'template') }}" _service_template_mounts: "{{ service_container_mounts | selectattr('type', '==', 'template') }}"