cluster/nomad/modules/nfs/main.tf
main 2e61e7ef3c
Reorganization and better Terraform
Signed-off-by: main <magic_rb@redalder.org>
2022-07-30 23:27:40 +02:00

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)
}
}
}