mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-opentofu-private.git
synced 2025-10-27 07:43:07 +00:00
Merge pull request '[deploy-opentofu]' (#306) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#306
This commit is contained in:
29
proxmox.tf
29
proxmox.tf
@ -177,10 +177,6 @@ resource "proxmox_virtual_environment_vm" "k8s_vms" {
|
||||
address = each.value.ip
|
||||
gateway = each.value.gateway
|
||||
}
|
||||
ipv4 {
|
||||
address = each.value.ip3
|
||||
gateway = each.value.gateway
|
||||
}
|
||||
}
|
||||
ip_config {
|
||||
ipv4 {
|
||||
@ -196,3 +192,28 @@ resource "proxmox_virtual_environment_vm" "k8s_vms" {
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user