mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-opentofu-private.git
synced 2025-10-27 15:53:06 +00:00
[deploy-opentofu]
[deploy-opentofu]
This commit is contained in:
25
proxmox.tf
25
proxmox.tf
@ -192,28 +192,3 @@ 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 = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user