mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-24 09:06:15 +01:00
2e61e7ef3c
Signed-off-by: main <magic_rb@redalder.org>
43 lines
690 B
HCL
43 lines
690 B
HCL
variable "region" {
|
|
type = string
|
|
}
|
|
|
|
variable "node_dcs" {
|
|
type = list(string)
|
|
}
|
|
|
|
variable "controller_dcs" {
|
|
type = list(string)
|
|
default = null
|
|
}
|
|
|
|
terraform {
|
|
required_providers {
|
|
nomad = {}
|
|
}
|
|
}
|
|
|
|
resource "nomad_job" "nfs-controller" {
|
|
jobspec = file("${path.module}/controller.hcl")
|
|
|
|
hcl2 {
|
|
enabled = true
|
|
vars = {
|
|
"region" = var.region
|
|
"datacenters" = jsonencode(var.controller_dcs == null ? var.node_dcs : var.controller_dcs)
|
|
}
|
|
}
|
|
}
|
|
|
|
resource "nomad_job" "nfs-node" {
|
|
jobspec = file("${path.module}/node.hcl")
|
|
|
|
hcl2 {
|
|
enabled = true
|
|
vars = {
|
|
"region" = var.region
|
|
"datacenters" = jsonencode(var.node_dcs)
|
|
}
|
|
}
|
|
}
|