orchestration-tests/nomad/services/backups/backups.tf
Ian Fijolek 04adb5db04 Go back to hard coded node names for for_each
For some reason this worked until it didn't
2022-10-31 15:24:14 -07:00

25 lines
603 B
HCL

resource "nomad_job" "backups" {
jobspec = templatefile("${path.module}/backup.nomad", {
module_path = "${path.module}",
batch_node = null,
})
}
# Get Nomad clients from Consul
data "consul_service" "nomad" {
name = "nomad-client"
}
resource "nomad_job" "backups-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
# ])
jobspec = templatefile("${path.module}/backup.nomad", {
module_path = "${path.module}",
batch_node = each.key,
})
}