diff --git a/terraform/node.tf b/terraform/node.tf index 55aaa07..745dd9e 100644 --- a/terraform/node.tf +++ b/terraform/node.tf @@ -3,10 +3,8 @@ locals { nodes = { for k, v in var.nodes : k => merge(v, { - id = 800 + index(keys(var.nodes), k) - hash = sha1(v.host) - mac_address = "AA:BB:07:00:${format("%v:%v", substr(sha1(v.host), 0, 2), substr(sha1(v.host), 2, 2))}" - domain = local.domain + id = 800 + index(keys(var.nodes), k) + domain = local.domain meta = { name = v.host domain = local.domain @@ -105,8 +103,7 @@ Repo: https://code.tjo.space/tjo-cloud/ingress } network_device { - bridge = "vmbr1" - mac_address = each.value.mac_address + bridge = "vmbr1" } scsi_hardware = "virtio-scsi-single" @@ -127,10 +124,12 @@ Repo: https://code.tjo.space/tjo-cloud/ingress ip_config { ipv4 { - address = "dhcp" + address = each.value.ipv4_address + gateway = each.value.ipv4_gateway } ipv6 { - address = "dhcp" + address = each.value.ipv6_address + gateway = each.value.ipv6_gateway } } } diff --git a/terraform/terraform.tfvars b/terraform/terraform.tfvars index e8d4e34..a8f4c3f 100644 --- a/terraform/terraform.tfvars +++ b/terraform/terraform.tfvars @@ -3,16 +3,31 @@ nodes = { host = "batuu" iso_storage = "local" boot_storage = "local-nvme" + + ipv4_address = "10.0.16.10/20" + ipv4_gateway = "10.0.16.1" + ipv6_address = "fd74:6a6f:0:1010::1/64" + ipv6_gateway = "fd74:6a6f:0:1000::1" } jakku = { host = "jakku" iso_storage = "local" boot_storage = "local-nvme" + + ipv4_address = "10.0.32.10/20" + ipv4_gateway = "10.0.32.1" + ipv6_address = "fd74:6a6f:0:2010::1/64" + ipv6_gateway = "fd74:6a6f:0:2000::1" } nevaroo = { host = "nevaroo" iso_storage = "local" boot_storage = "local" + + ipv4_address = "10.0.48.10/20" + ipv4_gateway = "10.0.48.1" + ipv6_address = "fd74:6a6f:0:3010::1/64" + ipv6_gateway = "fd74:6a6f:0:3000::1" } } diff --git a/terraform/variables.tf b/terraform/variables.tf index 8bb21e7..5ee7a6f 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -2,15 +2,11 @@ variable "nodes" { type = map(object({ host = string - internal = optional(object({ - ipv4 = string - ipv6 = string - })) - public = optional(object({ - ipv4 = string - ipv6 = string - })) + ipv4_address = string + ipv4_gateway = string + ipv6_address = string + ipv6_gateway = string cores = optional(number, 1) memory = optional(number, 512) @@ -26,21 +22,11 @@ variable "ssh_keys" { type = list(string) } -variable "digitalocean_token" { - type = string - sensitive = true -} - variable "proxmox_token" { type = string sensitive = true } -variable "tailscale_apikey" { - type = string - sensitive = true -} - variable "authentik_token" { type = string sensitive = true