ipv4 only edits

This commit is contained in:
2026-09-16 01:18:29 -04:00
parent 7882e85e57
commit 4b92cd198f
5 changed files with 31 additions and 14 deletions
+1 -1
View File
@@ -4,6 +4,6 @@ data "dns_a_record_set" "guests" {
} }
data "dns_aaaa_record_set" "guests" { data "dns_aaaa_record_set" "guests" {
for_each = var.vm_guests for_each = toset([for key,value in var.vm_guests: key if value.role != "download_client"])
host = "${each.key}.${var.local_domain}" host = "${each.key}.${var.local_domain}"
} }
+8 -5
View File
@@ -29,7 +29,7 @@ resource "proxmox_virtual_environment_vm" "this" {
wait_for_ip { wait_for_ip {
disabled = false disabled = false
ipv4 = true ipv4 = true
ipv6 = true ipv6 = each.value.role == "download_client" ? false : true
} }
} }
audio_device { audio_device {
@@ -46,7 +46,7 @@ resource "proxmox_virtual_environment_vm" "this" {
type = "x86-64-v2" type = "x86-64-v2"
units = 100 units = 100
} }
description = each.value.role == "container_host" ? "Arch Linux container host" : "Arch Linux download client" description = each.value.description
disk { disk {
aio = "io_uring" aio = "io_uring"
backup = true backup = true
@@ -61,7 +61,7 @@ resource "proxmox_virtual_environment_vm" "this" {
size = 64 size = 64
} }
dynamic "disk" { dynamic "disk" {
for_each = each.value.role == "container_host" ? [1] : [] for_each = each.value.role == "cluster_support" ? [1] : []
content { content {
aio = "io_uring" aio = "io_uring"
backup = true backup = true
@@ -92,18 +92,21 @@ resource "proxmox_virtual_environment_vm" "this" {
file_format = "raw" file_format = "raw"
dns { dns {
domain = var.local_domain domain = var.local_domain
servers = concat(var.ipv4_nameservers, var.ipv6_nameservers) servers = each.value.role == "download_client" ? var.ipv4_nameservers : concat(var.ipv4_nameservers, var.ipv6_nameservers)
} }
ip_config { ip_config {
ipv4 { ipv4 {
address = "${data.dns_a_record_set.guests[each.key].addrs[0]}/${var.ipv4_subnet_mask}" address = "${data.dns_a_record_set.guests[each.key].addrs[0]}/${var.ipv4_subnet_mask}"
gateway = var.ipv4_gateway gateway = var.ipv4_gateway
} }
ipv6 { dynamic "ipv6" {
for_each = each.value.role != "download_client" ? [1] : []
content {
address = "${data.dns_aaaa_record_set.guests[each.key].addrs[0]}/64" address = "${data.dns_aaaa_record_set.guests[each.key].addrs[0]}/64"
gateway = var.ipv6_gateway gateway = var.ipv6_gateway
} }
} }
}
user_account { user_account {
keys = [ keys = [
local.arch_public_key local.arch_public_key
+1
View File
@@ -2,6 +2,7 @@ variable "vm_guests" {
type = map(object({ type = map(object({
host = string host = string
role = string role = string
description = string
})) }))
} }
+1 -1
View File
@@ -1,2 +1,2 @@
arch_mirror = "mirrors.kernel.org/archlinux" arch_mirror = "mirrors.mit.edu/archlinux"
arch_username = "ladmin" arch_username = "ladmin"
+18 -5
View File
@@ -1,14 +1,27 @@
vm_guests = { vm_guests = {
ch01 ={ ns01 ={
host = "hv02" host = "hv02"
role = "container_host" role = "nameserver"
description = "Authoritative nameserver, 1 of 2"
} }
ch02 ={ ns02 ={
host = "hv03" host = "hv03"
role = "container_host" role = "nameserver"
description = "Authoritative nameserver, 2 of 2"
}
cs01 ={
host = "hv02"
role = "cluster_support"
description = "Cluster support server (registry, gitops repo), 1 of 2"
}
cs02 ={
host = "hv03"
role = "cluster_support"
description = "Cluster support server (registry, gitops repo), 2 of 2"
} }
dl01 ={ dl01 ={
host = "hv03" host = "hv01"
role = "download_client" role = "download_client"
description = "Torrent search and download server, IPv4 only"
} }
} }