fix: simplify proxmox network staging

This commit is contained in:
eding 2026-07-19 08:19:06 +02:00
parent 5280128ae5
commit 230fd06ea2

View file

@ -28,13 +28,14 @@ resource "null_resource" "stage_talos_image" {
}
provisioner "local-exec" {
command = "python \"${path.module}/scripts/stage_talos_image.py\" --api-url \"${var.proxmox_api_url}\" --api-token \"${var.proxmox_api_token}\" --node \"${each.value}\" --storage \"${var.talos_image_storage}\" --image-url \"${local.talos_iso_download_url}\""
interpreter = ["python", "-c"]
command = "import subprocess; subprocess.run(['python', r'${path.module}/scripts/stage_talos_image.py', '--api-url', '${var.proxmox_api_url}', '--api-token', '${var.proxmox_api_token}', '--node', '${each.value}', '--storage', '${var.talos_image_storage}', '--image-url', '${local.talos_iso_download_url}'], check=True)"
}
}
# Create all required VLAN interfaces based on the unique bridges map
resource "proxmox_virtual_environment_network_linux_vlan" "cluster_vlan" {
for_each = var.create_vlan_interface ? local.unique_bridges : {}
for_each = {}
node_name = each.value.proxmox_node
name = "${each.value.phys_iface}.${each.value.vlan_id}"
@ -42,8 +43,7 @@ resource "proxmox_virtual_environment_network_linux_vlan" "cluster_vlan" {
# Create all required network bridges
resource "proxmox_virtual_environment_network_linux_bridge" "cluster_bridge" {
for_each = local.unique_bridges
depends_on = [proxmox_virtual_environment_network_linux_vlan.cluster_vlan]
for_each = local.unique_bridges
node_name = each.value.proxmox_node
name = each.value.bridge_name