service: Imrove native sockets
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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') }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user