mirror of
https://github.com/kemko/nomad.git
synced 2026-01-08 03:15:42 +03:00
This test exercises the behavior of clients that become disconnected and have their allocations replaced. Future test cases will exercise the `max_client_disconnect` field on the job spec.
36 lines
580 B
HCL
36 lines
580 B
HCL
variable "nodeID" {
|
|
type = string
|
|
}
|
|
|
|
variable "time" {
|
|
type = string
|
|
default = "0"
|
|
}
|
|
|
|
job "restart-node" {
|
|
type = "batch"
|
|
datacenters = ["dc1", "dc2"]
|
|
|
|
group "group" {
|
|
|
|
constraint {
|
|
attribute = "${attr.kernel.name}"
|
|
value = "linux"
|
|
}
|
|
constraint {
|
|
attribute = "${node.unique.id}"
|
|
value = "${var.nodeID}"
|
|
}
|
|
|
|
task "task" {
|
|
driver = "raw_exec"
|
|
config {
|
|
command = "/bin/sh"
|
|
args = ["-c",
|
|
"systemctl stop nomad; sleep ${var.time}; systemctl start nomad"]
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|