♻️ Use a variable for proxmox VM storage

This commit is contained in:
Jérôme Petazzoni
2025-02-17 18:38:18 +01:00
parent 84365d03c6
commit a05d1f9d4f
3 changed files with 10 additions and 2 deletions

View File

@@ -13,6 +13,11 @@ variable "proxmox_password" {
default = null
}
variable "proxmox_storage" {
type = string
default = "local"
}
variable "proxmox_template_node_name" {
type = string
default = null

View File

@@ -18,7 +18,7 @@ resource "proxmox_virtual_environment_vm" "_" {
dedicated = split(" ", each.value.node_size)[1]
}
#disk {
# datastore_id = "ceph"
# datastore_id = var.proxmox_storage
# file_id = proxmox_virtual_environment_file._.id
# interface = "scsi0"
# size = 30
@@ -33,7 +33,7 @@ resource "proxmox_virtual_environment_vm" "_" {
enabled = true
}
initialization {
datastore_id = "ceph"
datastore_id = var.proxmox_storage
user_account {
username = "ubuntu"
keys = [trimspace(tls_private_key.ssh.public_key_openssh)]

View File

@@ -8,6 +8,9 @@ proxmox_endpoint = "https://localhost:8006/"
proxmox_username = "terraform@pve"
proxmox_password = "CHANGEME"
# Which storage to use for VM disks. Defaults to "local".
#proxmox_storage = "ceph"
proxmox_template_node_name = "CHANGEME"
proxmox_template_vm_id = CHANGEME