provider "proxmox" { endpoint = var.proxmox_server api_token = var.proxmox_apikey ssh { agent = true username = "terraform" } } resource "proxmox_virtual_environment_download_file" "Fedora-iso" { content_type = "iso" # tipo do arquivo datastore_id = "local" # datastore do Proxmox onde o arquivo será guardado node_name = "fenix" # nó do Proxmox onde será armazenado target_path = "/var/lib/vz/template/iso/iac-Fedora-Workstation-Live-x86_64-41-1.4.iso" url = "https://download.fedoraproject.org/pub/fedora/linux/releases/41/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-41-1.4.iso" } resource "proxmox_virtual_environment_vm" "proxmox-kubernetes-VM-template" { name = "proxmox-kubernetes-VM-template" node_name = "fenix" vm_id = 1002 template = true started = false tags = ["opentofu", "kubernetes", "fedora"] machine = "q35" bios = "seabios" description = "kubernetes VM Template created via iac" cpu { cores = 2 } memory { dedicated = 2048 } # Configuração do disco rígido disk { datastore_id = "local-lvm" interface = "scsi0" size = 64 } # Configuração da interface de rede network_device { bridge = "vmbr0" model = "virtio" } # Configuração do CD-ROM com a ISO cdrom { enabled = true file_id = "local:iso/iac-Fedora-Workstation-Live-x86_64-41-1.4.iso" } initialization { ip_config { ipv4 { address = "dhcp" } } } }