From cdd4e9b5d57eb776f74e7d035ffa3bd1205d3fce Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Thu, 30 Nov 2023 13:22:38 -0800 Subject: [PATCH] Fix custom ports for services --- services/service/service_template.nomad | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/services/service/service_template.nomad b/services/service/service_template.nomad index ccc4b04..d2faa08 100644 --- a/services/service/service_template.nomad +++ b/services/service/service_template.nomad @@ -31,10 +31,18 @@ job "${name}" { %{~ endif ~} %{~ for port in ports } port "${port.name}" { - %{ if port.host_network != null }host_network = "${port.host_network}"%{ endif ~} - %{ if port.from != null }to = ${port.from}%{ endif ~} - %{ if port.to != null }to = ${port.to}%{ endif ~} - %{ if port.static != null }static = ${port.static}%{ endif ~} + %{~ if port.host_network != null ~} + host_network = "${port.host_network}" + %{~ endif ~} + %{~ if port.from != null ~} + from = ${port.from} + %{~ endif ~} + %{~ if port.to != null ~} + to = ${port.to} + %{~ endif ~} + %{~ if port.static != null ~} + static = ${port.static} + %{~ endif ~} } %{~ endfor ~} }