service: Support udp port mappings
This commit is contained in:
@@ -113,6 +113,14 @@ argument_specs:
|
||||
description: Container port to publish
|
||||
type: int
|
||||
required: true
|
||||
protocol:
|
||||
description: Protocol of the port
|
||||
type: str
|
||||
required: false
|
||||
default: tcp
|
||||
choices:
|
||||
- tcp
|
||||
- udp
|
||||
type:
|
||||
description: Whether to publish as a port or socket
|
||||
type: str
|
||||
@@ -495,6 +503,14 @@ argument_specs:
|
||||
description: Container port to publish
|
||||
type: int
|
||||
required: true
|
||||
protocol:
|
||||
description: Protocol of the port
|
||||
type: str
|
||||
required: false
|
||||
default: tcp
|
||||
choices:
|
||||
- tcp
|
||||
- udp
|
||||
type:
|
||||
description: Whether to publish as a port or socket
|
||||
type: str
|
||||
|
||||
@@ -152,6 +152,7 @@ _service_additional_container_publish_ports: >-
|
||||
_service_additional_container_publish_port_ports | map(attribute='host_port'),
|
||||
_service_additional_container_publish_port_ports | map(attribute='container_port')
|
||||
) | map('join', ':')
|
||||
| zip(_service_additional_container_publish_port_ports | map(attribute='protocol')) | map('join', '/')
|
||||
}}
|
||||
|
||||
_service_additional_volume_mounts: "{{ _service_additional_container.mounts | selectattr('type', '==', 'volume') }}"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
_service_container_publish_ports_with_defaults: >-
|
||||
{{
|
||||
([{ 'type': 'port', 'host_address': '0.0.0.0' }] * service_container_publish_ports | length)
|
||||
([{ 'type': 'port', 'host_address': '0.0.0.0', 'protocol': 'tcp' }] * service_container_publish_ports | length)
|
||||
| zip(service_container_publish_ports)
|
||||
| map('combine')
|
||||
}}
|
||||
@@ -13,9 +13,10 @@ _service_container_publish_port_ports: >-
|
||||
|
||||
_service_container_publish_ports: >-
|
||||
{{
|
||||
_service_container_publish_port_ports | map(attribute='host_address') |
|
||||
zip(
|
||||
_service_container_publish_port_ports | map(attribute='host_address')
|
||||
| zip(
|
||||
_service_container_publish_port_ports | map(attribute='host_port'),
|
||||
_service_container_publish_port_ports | map(attribute='container_port')
|
||||
) | map('join', ':')
|
||||
| zip(_service_container_publish_port_ports | map(attribute='protocol')) | map('join', '/')
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user