Use pushgateway with restic scheduler batches

Batches can't run due to incorrectly scoped variables
This commit is contained in:
IamTheFij 2023-05-09 15:56:53 -07:00
parent 5169aecc6d
commit 5dc0e4bcaf

View File

@ -69,13 +69,17 @@ job "backup%{ if batch_node != null }-oneoff-${batch_node}%{ endif }" {
} }
config { config {
image = "iamthefij/resticscheduler" image = "iamthefij/resticscheduler:0.1.1"
ports = ["metrics"] ports = ["metrics"]
args = [ args = [
%{ if batch_node != null ~} %{ if batch_node != null ~}
"-once", "-once",
"-$${NOMAD_META_task}", "-$${NOMAD_META_task}",
"$${NOMAD_META_job_name}", "$${NOMAD_META_job_name}",
"--snapshot",
"$${NOMAD_META_snapshot}",
"--push-gateway",
"http://pushgateway.nomad:9091",
%{ endif ~} %{ endif ~}
"$${NOMAD_TASK_DIR}/node-jobs.hcl", "$${NOMAD_TASK_DIR}/node-jobs.hcl",
] ]