ipv4 only edits
This commit is contained in:
@@ -4,6 +4,6 @@ data "dns_a_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}"
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ resource "proxmox_virtual_environment_vm" "this" {
|
||||
wait_for_ip {
|
||||
disabled = false
|
||||
ipv4 = true
|
||||
ipv6 = true
|
||||
ipv6 = each.value.role == "download_client" ? false : true
|
||||
}
|
||||
}
|
||||
audio_device {
|
||||
@@ -46,7 +46,7 @@ resource "proxmox_virtual_environment_vm" "this" {
|
||||
type = "x86-64-v2"
|
||||
units = 100
|
||||
}
|
||||
description = each.value.role == "container_host" ? "Arch Linux container host" : "Arch Linux download client"
|
||||
description = each.value.description
|
||||
disk {
|
||||
aio = "io_uring"
|
||||
backup = true
|
||||
@@ -61,7 +61,7 @@ resource "proxmox_virtual_environment_vm" "this" {
|
||||
size = 64
|
||||
}
|
||||
dynamic "disk" {
|
||||
for_each = each.value.role == "container_host" ? [1] : []
|
||||
for_each = each.value.role == "cluster_support" ? [1] : []
|
||||
content {
|
||||
aio = "io_uring"
|
||||
backup = true
|
||||
@@ -92,16 +92,19 @@ resource "proxmox_virtual_environment_vm" "this" {
|
||||
file_format = "raw"
|
||||
dns {
|
||||
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 {
|
||||
ipv4 {
|
||||
address = "${data.dns_a_record_set.guests[each.key].addrs[0]}/${var.ipv4_subnet_mask}"
|
||||
gateway = var.ipv4_gateway
|
||||
}
|
||||
ipv6 {
|
||||
address = "${data.dns_aaaa_record_set.guests[each.key].addrs[0]}/64"
|
||||
gateway = var.ipv6_gateway
|
||||
dynamic "ipv6" {
|
||||
for_each = each.value.role != "download_client" ? [1] : []
|
||||
content {
|
||||
address = "${data.dns_aaaa_record_set.guests[each.key].addrs[0]}/64"
|
||||
gateway = var.ipv6_gateway
|
||||
}
|
||||
}
|
||||
}
|
||||
user_account {
|
||||
|
||||
@@ -2,6 +2,7 @@ variable "vm_guests" {
|
||||
type = map(object({
|
||||
host = string
|
||||
role = string
|
||||
description = string
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
arch_mirror = "mirrors.kernel.org/archlinux"
|
||||
arch_mirror = "mirrors.mit.edu/archlinux"
|
||||
arch_username = "ladmin"
|
||||
@@ -1,14 +1,27 @@
|
||||
vm_guests = {
|
||||
ch01 ={
|
||||
ns01 ={
|
||||
host = "hv02"
|
||||
role = "container_host"
|
||||
role = "nameserver"
|
||||
description = "Authoritative nameserver, 1 of 2"
|
||||
}
|
||||
ch02 ={
|
||||
ns02 ={
|
||||
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 ={
|
||||
host = "hv03"
|
||||
host = "hv01"
|
||||
role = "download_client"
|
||||
description = "Torrent search and download server, IPv4 only"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user