Fix backup conditionals

This commit is contained in:
IamTheFij 2023-03-24 23:34:23 -07:00
parent f1098d6448
commit 8e3fbcedb9

View File

@ -114,41 +114,39 @@ RCLONE_FTP_NO_CHECK_CERTIFICATE=true
template { template {
# Build jobs based on node # Build jobs based on node
data = <<EOF data = <<EOF
# Current node is {{ env "node.unique.name" }} # Current node is {{ env "node.unique.name" }} {{ env "node.unique.id" }}
{{ range nomadService "nextcloud" -}}
# nextcloud .Node {{ .Node }}
{{ if eq .NodeId (env "node.unique.id") -}}
${file("${module_path}/jobs/nextcloud.hcl")}
{{- end }}
{{- end }}
{{ range nomadService "grafana" -}} {{ range nomadService "grafana" -}}
{{ if eq .NodeId (env "node.unique.id") -}} # grafana .Node {{ .Node }}
{{ if eq .Node (env "node.unique.id") -}}
${file("${module_path}/jobs/grafana.hcl")} ${file("${module_path}/jobs/grafana.hcl")}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{ range nomadService "photoprism" -}} {{ range nomadService "photoprism" -}}
{{ if eq .NodeId (env "node.unique.id") -}} # photoprism .Node {{ .Node }}
{{ if eq .Node (env "node.unique.id") -}}
${file("${module_path}/jobs/photoprism.hcl")} ${file("${module_path}/jobs/photoprism.hcl")}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{ range service "lldap" -}} {{ range nomadService "lldap" -}}
{{ if eq .NodeId (env "node.unique.id") -}} # lldap .Node {{ .Node }}
{{ if eq .Node (env "node.unique.id") -}}
${file("${module_path}/jobs/lldap.hcl")} ${file("${module_path}/jobs/lldap.hcl")}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{ range service "sonarr" -}} {{ range nomadService "sonarr" -}}
{{ if eq .NodeId (env "node.unique.id") -}} # sonarr .Node {{ .Node }}
{{ if eq .Node (env "node.unique.id") -}}
${file("${module_path}/jobs/sonarr.hcl")} ${file("${module_path}/jobs/sonarr.hcl")}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{ range service "nzbget" -}} {{ range nomadService "nzbget" -}}
{{ if eq .NodeId (env "node.unique.id") -}} # nzbget .Node {{ .Node }}
{{ if eq .Node (env "node.unique.id") -}}
${file("${module_path}/jobs/nzbget.hcl")} ${file("${module_path}/jobs/nzbget.hcl")}
{{- end }} {{- end }}
{{- end }} {{- end }}