feat: use static ips

This commit is contained in:
Tine 2024-11-08 22:11:27 +01:00
parent 5a116ddf9c
commit e189401d95
Signed by: mentos1386
SSH key fingerprint: SHA256:MNtTsLbihYaWF8j1fkOHfkKNlnN1JQfxEU/rBU8nCGw
3 changed files with 26 additions and 26 deletions

View file

@ -4,8 +4,6 @@ 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
meta = {
name = v.host
@ -106,7 +104,6 @@ Repo: https://code.tjo.space/tjo-cloud/ingress
network_device {
bridge = "vmbr1"
mac_address = each.value.mac_address
}
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
}
}
}

View file

@ -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"
}
}

View file

@ -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