Add dummy backup job to keep backup task running on all hosts

Otherwise, if a client is not running any stateful services, the task
will fail and Nomad will eventually stop retrying. If a service gets
relocated to the host, the task is not restarted. This makes sure the
task will cover moved services and make it more easy to determine that
backups are healthy.
This commit is contained in:
IamTheFij 2023-11-16 12:18:01 -08:00
parent 9b347880cc
commit 0d208b7394

View File

@ -136,6 +136,24 @@ ${file("${module_path}/${job_file}")}
{{ end -}} {{ end -}}
{{ end -}} {{ end -}}
%{ endfor ~} %{ endfor ~}
# Dummy job to keep task healthy on node without any stateful services
job "Dummy" {
schedule = "0 0 1 1 0"
config {
repo = "/local/dummy-repo"
passphrase = env("BACKUP_PASSPHRASE")
}
backup {
paths = ["/local/node-jobs.hcl"]
}
forget {
KeepLast = 1
}
}
EOF EOF
destination = "local/node-jobs.hcl" destination = "local/node-jobs.hcl"
} }