60 lines
1003 B
HCL
60 lines
1003 B
HCL
job "fixers" {
|
|
|
|
type = "batch"
|
|
|
|
periodic {
|
|
cron = "*/15 * * * * *"
|
|
prohibit_overlap = true
|
|
}
|
|
|
|
group "orphaned_services" {
|
|
task "orphaned_services" {
|
|
driver = "docker"
|
|
|
|
config {
|
|
image = "iamthefij/nomad-service-fixers:0.1.1"
|
|
command = "/scripts/nomad_orphan_services.py"
|
|
args = ["--delete"]
|
|
}
|
|
|
|
env = {
|
|
NOMAD_ADDR = "http+unix://%2Fsecrets%2Fapi.sock"
|
|
}
|
|
|
|
identity {
|
|
env = true
|
|
}
|
|
|
|
resources {
|
|
cpu = 50
|
|
memory = 100
|
|
}
|
|
}
|
|
}
|
|
|
|
group "missing_services" {
|
|
task "missing_services" {
|
|
driver = "docker"
|
|
|
|
config {
|
|
image = "iamthefij/nomad-service-fixers:0.1.0"
|
|
command = "/scripts/nomad_missing_services.py"
|
|
args = ["--restart"]
|
|
}
|
|
|
|
env = {
|
|
NOMAD_ADDR = "http+unix://%2Fsecrets%2Fapi.sock"
|
|
}
|
|
|
|
identity {
|
|
env = true
|
|
}
|
|
|
|
resources {
|
|
cpu = 50
|
|
memory = 100
|
|
}
|
|
}
|
|
}
|
|
}
|