feat: use static ips
This commit is contained in:
parent
5a116ddf9c
commit
e189401d95
3 changed files with 26 additions and 26 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue