Update terraform/main.tf

This commit is contained in:
2026-02-15 20:58:23 +01:00
parent d306ede24d
commit a679272366

View File

@@ -1,6 +1,25 @@
resource "proxmox_vm_qemu" "ubuntu2404" { terraform {
required_providers {
proxmox = {
source = "telmate/proxmox"
version = "3.0.2-rc07"
}
}
}
provider "proxmox" {
pm_api_url = "https://proxmox.example.com:8006/api2/json"
pm_user = "root@pam"
pm_password = "yourpassword"
pm_tls_insecure = true
}
resource "proxmox_vm_qemu" "ubuntu2404_vm" {
name = "terraform-vm" name = "terraform-vm"
target_node = "nuctyzyzen7-1" target_node = "nuctyzyzen7-1"
vmid = 9505
full_clone = true
clone = "ubuntu-2404-ci-template" # jouw werkende template
cores = 2 cores = 2
sockets = 1 sockets = 1
@@ -9,20 +28,18 @@ resource "proxmox_vm_qemu" "ubuntu2404" {
machine = "q35" machine = "q35"
agent = 1 agent = 1
# Bootdisk vanaf cloud image # Bootdisk clonen van template
disk { disk {
slot = "scsi0" slot = "virtio0"
type = "disk" type = "disk"
storage = "zfs1" storage = "zfs1"
size = "20G" size = "32G"
format = "qcow2"
cache = "writeback" cache = "writeback"
discard = true discard = true
# Als je image al geüpload is, kun je clone= gebruiken clone = "ubuntu-2404-ci-template/virtio0" # belangrijk!
# clone = "999/virtio0"
} }
# Cloud-init drive # Cloud-init CD-ROM wordt automatisch toegevoegd
disk { disk {
slot = "scsi1" slot = "scsi1"
type = "cdrom" type = "cdrom"
@@ -35,7 +52,7 @@ resource "proxmox_vm_qemu" "ubuntu2404" {
bridge = "vmbr0" bridge = "vmbr0"
} }
# Cloud-init configuratie # Cloud-init instellingen
os_type = "cloud-init" os_type = "cloud-init"
ciuser = "martijn" ciuser = "martijn"
cipassword = "Gwh28dgcmp!" cipassword = "Gwh28dgcmp!"