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:
parent
9b347880cc
commit
0d208b7394
@ -136,6 +136,24 @@ ${file("${module_path}/${job_file}")}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
%{ 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
|
||||
destination = "local/node-jobs.hcl"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user