From 882fe7e29cdba15ac67d4bdf84555c1b21987645 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Thu, 2 Mar 2023 10:42:33 -0800 Subject: [PATCH] Some cleanup of service template whitespace --- services/service/service_template.nomad | 35 +++++++++++-------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/services/service/service_template.nomad b/services/service/service_template.nomad index 2357a95..e557136 100644 --- a/services/service/service_template.nomad +++ b/services/service/service_template.nomad @@ -9,37 +9,34 @@ job "${name}" { mode = "bridge" %{ if service_port != null ~} port "main" { - %{ if ingress ~} + %{ if ingress } host_network = "loopback" - %{ endif ~} + %{~ endif } to = ${service_port} } - %{ endif ~} + %{ endif } } - %{ if length(group_meta) > 0 ~} + %{ if length(group_meta) > 0 } meta = { - %{ for k, v in group_meta ~} + %{ for k, v in group_meta } ${k} = ${jsonencode(v)} - %{ endfor ~} + %{ endfor } } - - %{ endif ~} - %{ if sticky_disk ~} + %{~ endif } + %{ if sticky_disk } ephemeral_disk { migrate = true sticky = true } - - %{ endif ~} - %{ for host_volume in host_volumes ~} + %{~ endif } + %{ for host_volume in host_volumes } volume "${host_volume.name}" { type = "host" read_only = ${host_volume.read_only} source = "${host_volume.name}" } - - %{ endfor ~} + %{ endfor } %{ if service_port != null ~} service { name = "${replace(name, "_", "-")}" @@ -86,8 +83,8 @@ job "${name}" { } } - %{ endif ~} - %{ if healthcheck_path != null ~} + %{~ endif } + %{ if healthcheck_path != null } check { type = "http" path = "${healthcheck_path}" @@ -104,7 +101,7 @@ job "${name}" { %{ endif ~} tags = [ - %{ if ingress ~} + %{ if ingress } "traefik.enable=true", "traefik.http.routers.${name}.entryPoints=websecure", %{ if try(ingress_rule, null) != null ~} @@ -112,8 +109,8 @@ job "${name}" { %{ endif ~} %{ for middleware in ingress_middlewares ~} "traefik.http.routers.${name}.middlewares=${middleware}", - %{ endfor ~} - %{ endif ~} + %{~ endfor } + %{~ endif } ] }