homelab-nomad/services/backups/backups.tf

29 lines
574 B
Terraform
Raw Permalink Normal View History

resource "nomad_job" "backup" {
2023-07-07 22:50:58 +00:00
hcl2 {
enabled = true
}
jobspec = templatefile("${path.module}/backup.nomad", {
2022-11-02 19:32:27 +00:00
module_path = path.module,
batch_node = null,
})
}
resource "nomad_job" "backup-oneoff" {
# TODO: Get list of nomad hosts dynamically
2023-08-03 16:53:03 +00:00
for_each = toset(["n1", "n2", "pi4"])
# for_each = toset([
# for node in data.consul_service.nomad.service :
# node.node_name
# ])
2023-07-07 22:50:58 +00:00
hcl2 {
enabled = true
}
jobspec = templatefile("${path.module}/backup.nomad", {
2022-11-02 19:32:27 +00:00
module_path = path.module,
batch_node = each.key,
})
}