23 lines
920 B
YAML
23 lines
920 B
YAML
---
|
|
_service_container_publish_ports_with_defaults: >-
|
|
{{
|
|
([{ 'type': 'port', 'host_address': '0.0.0.0', 'protocol': 'tcp' }] * service_container_publish_ports | length)
|
|
| zip(service_container_publish_ports)
|
|
| map('combine')
|
|
}}
|
|
|
|
_service_container_publish_socket_ports: >-
|
|
{{ _service_container_publish_ports_with_defaults | selectattr('type', '==', 'socket') }}
|
|
_service_container_publish_port_ports: >-
|
|
{{ _service_container_publish_ports_with_defaults | selectattr('type', '==', 'port') }}
|
|
|
|
_service_container_publish_ports: >-
|
|
{{
|
|
_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', '/')
|
|
}}
|