init
This commit is contained in:
45
terraform/main.tf
Normal file
45
terraform/main.tf
Normal 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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user