summaryrefslogtreecommitdiff
path: root/jobs
diff options
context:
space:
mode:
Diffstat (limited to 'jobs')
-rw-r--r--jobs/virtual-hosting.nomad.hcl33
1 files changed, 17 insertions, 16 deletions
diff --git a/jobs/virtual-hosting.nomad.hcl b/jobs/virtual-hosting.nomad.hcl
index 2ed377f..638a1c9 100644
--- a/jobs/virtual-hosting.nomad.hcl
+++ b/jobs/virtual-hosting.nomad.hcl
@@ -42,25 +42,26 @@ job "virtual-hosting" {
template {
data = <<EOF
{{- range nomadServices -}}
- {{- $hostname := "" -}}
- {{- $certname := "" -}}
- {{- $default := "" -}}
- {{- range $tag := .Tags -}}
- {{- if $tag | regexMatch "nginx.hostname=" -}}
- {{- $hostname = $tag | replaceAll "nginx.hostname=" "" -}}
- {{- end -}}
- {{- if $tag | regexMatch "nginx.certname=" -}}
- {{- $certname = $tag | replaceAll "nginx.certname=" "" -}}
- {{- end -}}
- {{- if $tag | regexMatch "nginx.default_server" -}}
- {{- $default = "default_server" -}}
- {{- end -}}
+
+{{- $hostname := "" -}}
+{{- $certname := "" -}}
+{{- $default := "" -}}
+{{- range $tag := .Tags -}}
+ {{- if $tag | regexMatch "nginx.hostname=" -}}
+ {{- $hostname = $tag | replaceAll "nginx.hostname=" "" -}}
+ {{- end -}}
+ {{- if $tag | regexMatch "nginx.certname=" -}}
+ {{- $certname = $tag | replaceAll "nginx.certname=" "" -}}
{{- end -}}
- {{- if eq $hostname "" -}}
- {{- continue -}}
+ {{- if $tag | regexMatch "nginx.default_server" -}}
+ {{- $default = "default_server" -}}
{{- end -}}
+{{- end -}}
+{{- if eq $hostname "" -}}
+ {{- continue -}}
+{{- end -}}
- {{- $upstream := .Name | toLower | regexReplaceAll "[^a-z0-9\\-._]" "" -}}
+{{- $upstream := .Name | toLower | regexReplaceAll "[^a-z0-9\\-._]" "" -}}
################################################
upstream {{ $upstream }} {