2023-03-24 16:32:37 -07:00
|
|
|
resource "nomad_job" "backup" {
|
2023-07-07 15:50:58 -07:00
|
|
|
hcl2 {
|
|
|
|
enabled = true
|
|
|
|
}
|
|
|
|
|
2022-07-27 17:02:29 -07:00
|
|
|
jobspec = templatefile("${path.module}/backup.nomad", {
|
2022-11-02 12:32:27 -07:00
|
|
|
module_path = path.module,
|
2022-07-27 17:02:29 -07:00
|
|
|
batch_node = null,
|
|
|
|
})
|
2022-05-18 14:23:28 -07:00
|
|
|
}
|
|
|
|
|
2023-03-24 16:32:37 -07:00
|
|
|
resource "nomad_job" "backup-oneoff" {
|
2022-10-27 14:28:34 -07:00
|
|
|
# TODO: Get list of nomad hosts dynamically
|
2023-08-03 09:53:03 -07:00
|
|
|
for_each = toset(["n1", "n2", "pi4"])
|
2022-10-31 15:21:25 -07:00
|
|
|
# for_each = toset([
|
|
|
|
# for node in data.consul_service.nomad.service :
|
|
|
|
# node.node_name
|
|
|
|
# ])
|
2023-07-07 15:50:58 -07:00
|
|
|
|
|
|
|
hcl2 {
|
|
|
|
enabled = true
|
|
|
|
}
|
|
|
|
|
2022-07-27 17:02:29 -07:00
|
|
|
jobspec = templatefile("${path.module}/backup.nomad", {
|
2022-11-02 12:32:27 -07:00
|
|
|
module_path = path.module,
|
2022-07-27 17:02:29 -07:00
|
|
|
batch_node = each.key,
|
|
|
|
})
|
2022-05-18 14:23:28 -07:00
|
|
|
}
|