This commit is contained in:
MichaelFisher1997
2025-04-17 01:28:18 +01:00
commit f4a25faaf3
10 changed files with 504 additions and 0 deletions

45
terraform/main.tf Normal file
View File

@@ -0,0 +1,45 @@
terraform {
required_providers {
proxmox = {
source = "Telmate/proxmox"
version = "3.0.1-rc8"
}
}
}
provider "proxmox" {
pm_api_url = var.pm_api_url
pm_user = var.pm_user
pm_password = var.proxmox_password
pm_tls_insecure = true
}
resource "proxmox_vm_qemu" "alpine" {
count = var.vm_count
vmid = 400 + count.index + 1
name = "Alpine-${count.index + 1}"
target_node = var.target_node
clone = var.clone_template
sockets = var.sockets
cores = var.cores
memory = var.memory
agent = 1
boot = "order=scsi0"
os_type = "cloud-init"
disk {
slot = "scsi0"
type = "disk"
size = var.disk_size
storage = var.storage
}
network {
id = 0
model = "virtio"
bridge = var.bridge
}
}