homelab-nomad/services/nomad-fixers.nomad

49 lines
828 B
Plaintext
Raw Permalink Normal View History

job "fixers" {
type = "batch"
periodic {
cron = "*/15 * * * * *"
prohibit_overlap = true
}
group "main" {
task "orphaned_services" {
driver = "docker"
config {
2023-12-29 15:35:07 +00:00
image = "iamthefij/nomad-service-fixers:0.1.1"
command = "/scripts/nomad_orphan_services.py"
2023-11-06 22:41:54 +00:00
args = ["--delete"]
}
env = {
NOMAD_ADDR = "http+unix://%2Fsecrets%2Fapi.sock"
}
identity {
env = true
}
}
task "missing_services" {
driver = "docker"
config {
image = "iamthefij/nomad-service-fixers:0.1.0"
command = "/scripts/nomad_missing_services.py"
2023-11-06 22:41:54 +00:00
args = ["--restart"]
}
env = {
NOMAD_ADDR = "http+unix://%2Fsecrets%2Fapi.sock"
}
identity {
env = true
}
}
}
}