[deploy-opentofu]

[deploy-opentofu]
This commit is contained in:
2025-10-15 21:32:42 +00:00
parent 58d080dadd
commit 218ca3fc2f

View File

@ -177,10 +177,6 @@ resource "proxmox_virtual_environment_vm" "k8s_vms" {
address = each.value.ip address = each.value.ip
gateway = each.value.gateway gateway = each.value.gateway
} }
ipv4 {
address = each.value.ip3
gateway = each.value.gateway
}
} }
ip_config { ip_config {
ipv4 { ipv4 {
@ -196,3 +192,28 @@ resource "proxmox_virtual_environment_vm" "k8s_vms" {
enabled = true enabled = true
} }
} }
resource "null_resource" "add_api_ip" {
for_each = {
for vm in var.proxmox_k8s_vms : vm.name => vm
}
triggers = {
vm_id = each.value.vm_id
}
provisioner "remote-exec" {
inline = [
"sudo ip addr add ${each.value.ip} dev eth0"
]
connection {
type = "ssh"
host = split("/", each.value.ip)[0] // remove a máscara para conectar
user = each.value.extra_users.name
password = each.value.extra_users.password
timeout = "2m"
agent = false
}
}
}