4 Commits

Author SHA1 Message Date
7c46db0253 [deploy-opentofu]
[deploy-opentofu]
2025-10-15 21:40:03 +00:00
218ca3fc2f [deploy-opentofu]
[deploy-opentofu]
2025-10-15 21:32:42 +00:00
58d080dadd a 2025-10-15 21:19:39 +00:00
f797aa6d8b [deploy-opentofu] 2025-10-15 21:19:11 +00:00
2 changed files with 26 additions and 0 deletions

View File

@ -192,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.ip3} dev eth0"
]
connection {
type = "ssh"
host = split("/", each.value.ip)[0] // remove a máscara para conectar
user = each.value.extra_users[0].name
password = each.value.extra_users[0].password
timeout = "4m"
agent = false
}
}
}

View File

@ -41,6 +41,7 @@ variable "proxmox_k8s_vms" {
node_name = string node_name = string
ip = string ip = string
ip2 = string ip2 = string
ip3 = string
cores = optional(number) cores = optional(number)
memory = optional(number) memory = optional(number)
data_store = optional(string) data_store = optional(string)