fix: qemu ip
This commit is contained in:
@@ -5,7 +5,7 @@ locals {
|
|||||||
for vm in proxmox_virtual_environment_vm.controlplane :
|
for vm in proxmox_virtual_environment_vm.controlplane :
|
||||||
flatten([
|
flatten([
|
||||||
for iface_ips in vm.ipv4_addresses :
|
for iface_ips in vm.ipv4_addresses :
|
||||||
[for ip in iface_ips : ip if ip != "127.0.0.1"]
|
[for ip in iface_ips : ip if ip != "127.0.0.1" && ip != "169.254.116.108"]
|
||||||
])[0]
|
])[0]
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -13,17 +13,16 @@ locals {
|
|||||||
for vm in proxmox_virtual_environment_vm.worker :
|
for vm in proxmox_virtual_environment_vm.worker :
|
||||||
flatten([
|
flatten([
|
||||||
for iface_ips in vm.ipv4_addresses :
|
for iface_ips in vm.ipv4_addresses :
|
||||||
[for ip in iface_ips : ip if ip != "127.0.0.1"]
|
[for ip in iface_ips : ip if ip != "127.0.0.1" && ip != "169.254.116.108"]
|
||||||
])[0]
|
])[0]
|
||||||
]
|
]
|
||||||
|
|
||||||
# Use DHCP IPs for initial connection and configuration apply
|
# Use configured static IPs if set, otherwise use IPs from QEMU guest agent
|
||||||
# Note: If static IPs are configured via var.controlplane_ips/var.worker_ips,
|
# (On first run, uses DHCP from guest agent; after config, uses static IPs)
|
||||||
# Talos will reconfigure the network after initial apply, but we connect via DHCP
|
controlplane_ips = length(var.controlplane_ips) > 0 ? var.controlplane_ips : local.controlplane_dhcp_ips
|
||||||
controlplane_ips = local.controlplane_dhcp_ips
|
worker_ips = length(var.worker_ips) > 0 ? var.worker_ips : local.worker_dhcp_ips
|
||||||
worker_ips = local.worker_dhcp_ips
|
|
||||||
|
|
||||||
# For client config and bootstrap, use static IPs if configured, otherwise DHCP
|
# For client config and bootstrap, use static IPs if configured, otherwise current DHCP
|
||||||
controlplane_endpoints = length(var.controlplane_ips) > 0 ? var.controlplane_ips : local.controlplane_dhcp_ips
|
controlplane_endpoints = length(var.controlplane_ips) > 0 ? var.controlplane_ips : local.controlplane_dhcp_ips
|
||||||
|
|
||||||
# Extract Proxmox API URL without protocol for node labeling
|
# Extract Proxmox API URL without protocol for node labeling
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ data "talos_client_configuration" "this" {
|
|||||||
endpoints = local.controlplane_endpoints
|
endpoints = local.controlplane_endpoints
|
||||||
}
|
}
|
||||||
|
|
||||||
# Apply configuration to control plane nodes via DHCP IPs
|
# Apply configuration to control plane nodes via current IPs from QEMU agent
|
||||||
resource "talos_machine_configuration_apply" "controlplane" {
|
resource "talos_machine_configuration_apply" "controlplane" {
|
||||||
count = var.controlplane_count
|
count = var.controlplane_count
|
||||||
|
|
||||||
@@ -202,7 +202,7 @@ resource "talos_machine_configuration_apply" "controlplane" {
|
|||||||
depends_on = [time_sleep.wait_for_vms]
|
depends_on = [time_sleep.wait_for_vms]
|
||||||
}
|
}
|
||||||
|
|
||||||
# Apply configuration to worker nodes via DHCP IPs
|
# Apply configuration to worker nodes via current IPs from QEMU agent
|
||||||
resource "talos_machine_configuration_apply" "worker" {
|
resource "talos_machine_configuration_apply" "worker" {
|
||||||
count = var.worker_count
|
count = var.worker_count
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user