mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-opentofu-private.git
synced 2026-03-22 14:09:49 +00:00
Compare commits
15 Commits
a9ad0e9330
...
fenix-admi
| Author | SHA1 | Date | |
|---|---|---|---|
| 705c5df1f5 | |||
| 88de7affda | |||
| 4934c33104 | |||
| d2241e2dfa | |||
| 6fc1890c1c | |||
| 3e49c091f5 | |||
| 39cb2a6c20 | |||
| c11f2e3c25 | |||
| badfc5fa24 | |||
| d3db951dfa | |||
| 7a32716a23 | |||
| 1a8f746bbd | |||
| c70b254a84 | |||
| fb1f46a27d | |||
| 3a6706b9bc |
20
proxmox.tf
20
proxmox.tf
@ -19,7 +19,7 @@ resource "proxmox_virtual_environment_download_file" "latest_ubunto_cloud_img" {
|
|||||||
content_type = "iso"
|
content_type = "iso"
|
||||||
datastore_id = "local"
|
datastore_id = "local"
|
||||||
node_name = "fenix"
|
node_name = "fenix"
|
||||||
url = "https://cloud-images.ubuntu.com/jammy/20251023/jammy-server-cloudimg-amd64.img"
|
url = "https://cloud-images.ubuntu.com/jammy/20251206/jammy-server-cloudimg-amd64.img"
|
||||||
file_name = "jammyservercloudimgamd64.img"
|
file_name = "jammyservercloudimgamd64.img"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,6 +105,7 @@ resource "proxmox_virtual_environment_vm" "proxmox-kubernetes-VM-template" {
|
|||||||
|
|
||||||
cpu {
|
cpu {
|
||||||
cores = 2
|
cores = 2
|
||||||
|
type = "host"
|
||||||
}
|
}
|
||||||
|
|
||||||
memory {
|
memory {
|
||||||
@ -116,15 +117,14 @@ resource "proxmox_virtual_environment_vm" "proxmox-kubernetes-VM-template" {
|
|||||||
file_id = proxmox_virtual_environment_download_file.latest_ubunto_cloud_img.id
|
file_id = proxmox_virtual_environment_download_file.latest_ubunto_cloud_img.id
|
||||||
interface = "scsi0"
|
interface = "scsi0"
|
||||||
file_format = "qcow2"
|
file_format = "qcow2"
|
||||||
|
size = 64
|
||||||
}
|
}
|
||||||
|
|
||||||
# Configuração da interface de rede
|
# Configuração da interface de rede
|
||||||
network_device {
|
network_device {
|
||||||
bridge = "vmbr0" # rede de gestão para comunicação com Cluster A
|
bridge = "vmbr0" # rede de gestão para comunicação com Cluster B
|
||||||
vlan_id = 20
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
initialization {
|
initialization {
|
||||||
dns {
|
dns {
|
||||||
servers = ["1.1.1.1"]
|
servers = ["1.1.1.1"]
|
||||||
@ -149,10 +149,12 @@ resource "proxmox_virtual_environment_vm" "k8s_vms" {
|
|||||||
|
|
||||||
clone {
|
clone {
|
||||||
vm_id = proxmox_virtual_environment_vm.proxmox-kubernetes-VM-template.id
|
vm_id = proxmox_virtual_environment_vm.proxmox-kubernetes-VM-template.id
|
||||||
|
full = true
|
||||||
}
|
}
|
||||||
|
|
||||||
cpu {
|
cpu {
|
||||||
cores = each.value.cores
|
cores = each.value.cores
|
||||||
|
type = "host"
|
||||||
}
|
}
|
||||||
|
|
||||||
memory {
|
memory {
|
||||||
@ -165,6 +167,16 @@ resource "proxmox_virtual_environment_vm" "k8s_vms" {
|
|||||||
interface = "scsi1"
|
interface = "scsi1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Bloco dinâmico para lista de hostpci
|
||||||
|
dynamic "hostpci" {
|
||||||
|
for_each = try(each.value.hostpci, [])
|
||||||
|
content {
|
||||||
|
device = hostpci.value.device
|
||||||
|
pcie = try(hostpci.value.pcie, true)
|
||||||
|
mapping = hostpci.value.mapping
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
initialization {
|
initialization {
|
||||||
ip_config {
|
ip_config {
|
||||||
ipv4 {
|
ipv4 {
|
||||||
|
|||||||
@ -42,6 +42,11 @@ variable "proxmox_k8s_vms" {
|
|||||||
ip = string
|
ip = string
|
||||||
ip2 = string
|
ip2 = string
|
||||||
ip3 = string
|
ip3 = string
|
||||||
|
hostpci = optional(list(object({
|
||||||
|
pcie = bool
|
||||||
|
device = string
|
||||||
|
mapping = 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