mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-opentofu-private.git
synced 2025-10-27 07:43:07 +00:00
Compare commits
4 Commits
8b16085acf
...
7c46db0253
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c46db0253 | |||
| 218ca3fc2f | |||
| 58d080dadd | |||
| f797aa6d8b |
25
proxmox.tf
25
proxmox.tf
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user