63 lines
1.3 KiB
HCL
63 lines
1.3 KiB
HCL
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"
|
|
target_node = "nuctyzyzen7-1"
|
|
vmid = 9505
|
|
full_clone = true
|
|
clone = "ubuntu-2404-ci-template" # jouw werkende template
|
|
|
|
cores = 2
|
|
sockets = 1
|
|
memory = 4096
|
|
scsihw = "virtio-scsi-pci"
|
|
machine = "q35"
|
|
agent = 1
|
|
|
|
# Bootdisk clonen van template
|
|
disk {
|
|
slot = "virtio0"
|
|
type = "disk"
|
|
storage = "zfs1"
|
|
size = "32G"
|
|
cache = "writeback"
|
|
discard = true
|
|
clone = "ubuntu-2404-ci-template/virtio0" # belangrijk!
|
|
}
|
|
|
|
# Cloud-init CD-ROM wordt automatisch toegevoegd
|
|
disk {
|
|
slot = "scsi1"
|
|
type = "cdrom"
|
|
storage = "zfs1"
|
|
}
|
|
|
|
network {
|
|
id = 0
|
|
model = "virtio"
|
|
bridge = "vmbr0"
|
|
}
|
|
|
|
# Cloud-init instellingen
|
|
os_type = "cloud-init"
|
|
ciuser = "martijn"
|
|
cipassword = "Gwh28dgcmp!"
|
|
ipconfig0 = "ip=dhcp"
|
|
searchdomain = "domain.local"
|
|
nameserver = "192.168.178.1"
|
|
}
|