open-nomad/e2e/rescheduling/input/rescheduling_success.nomad
2023-04-10 15:36:59 +00:00

40 lines
660 B
HCL

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
job "test3" {
datacenters = ["dc1", "dc2"]
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
type = "service"
group "t3" {
count = 3
task "t3" {
driver = "raw_exec"
config {
command = "bash"
args = ["-c", "a=`cksum <<< \"${NOMAD_ALLOC_ID}\"| cut -d ' ' -f1`; if ! (( a % 2 )); then sleep 5000; else exit -1; fi"]
}
}
restart {
attempts = 0
delay = "0s"
mode = "fail"
}
reschedule {
attempts = 2
interval = "5m"
unlimited = false
}
}
}