29 lines
567 B
HCL
29 lines
567 B
HCL
resource "nomad_job" "backup" {
|
|
hcl2 {
|
|
enabled = true
|
|
}
|
|
|
|
jobspec = templatefile("${path.module}/backup.nomad", {
|
|
module_path = path.module,
|
|
batch_node = null,
|
|
})
|
|
}
|
|
|
|
resource "nomad_job" "backup-oneoff" {
|
|
# TODO: Get list of nomad hosts dynamically
|
|
for_each = toset(["n1", "n2"])
|
|
# for_each = toset([
|
|
# for node in data.consul_service.nomad.service :
|
|
# node.node_name
|
|
# ])
|
|
|
|
hcl2 {
|
|
enabled = true
|
|
}
|
|
|
|
jobspec = templatefile("${path.module}/backup.nomad", {
|
|
module_path = path.module,
|
|
batch_node = each.key,
|
|
})
|
|
}
|