Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions example/resource_virtual_environment_container.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ resource "proxmox_virtual_environment_container" "example_template" {
start_on_boot = "true"

disk {
datastore_id = "local-lvm"
datastore_id = var.virtual_environment_storage
size = 4
}

mount_point {
// volume mount
volume = "local-lvm"
volume = var.virtual_environment_storage
size = "4G"
path = "mnt/local"
}
Expand Down Expand Up @@ -66,7 +66,7 @@ resource "proxmox_virtual_environment_container" "example_template" {

resource "proxmox_virtual_environment_container" "example" {
disk {
datastore_id = "local-lvm"
datastore_id = var.virtual_environment_storage
}

clone {
Expand Down
14 changes: 2 additions & 12 deletions example/resource_virtual_environment_download_file.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
resource "proxmox_virtual_environment_download_file" "release_20250610_ubuntu_24_noble_lxc_img" {
content_type = "vztmpl"
datastore_id = "local"
node_name = "pve"
node_name = var.virtual_environment_node_name
url = var.release_20250610_ubuntu_24_noble_lxc_img_url
checksum = var.release_20250610_ubuntu_24_noble_lxc_img_checksum
checksum_algorithm = "sha256"
Expand All @@ -12,20 +12,10 @@ resource "proxmox_virtual_environment_download_file" "release_20250610_ubuntu_24
}

resource "proxmox_virtual_environment_download_file" "latest_debian_12_bookworm_qcow2_img" {
content_type = "iso"
datastore_id = "local"
file_name = "debian-12-generic-amd64.img"
node_name = "pve"
url = var.latest_debian_12_bookworm_qcow2_img_url
overwrite = true
overwrite_unmanaged = true
}

resource "proxmox_virtual_environment_download_file" "latest_debian_12_bookworm_qcow2" {
content_type = "import"
datastore_id = "local"
file_name = "debian-12-generic-amd64.qcow2"
node_name = "pve"
node_name = var.virtual_environment_node_name
url = var.latest_debian_12_bookworm_qcow2_img_url
overwrite = true
overwrite_unmanaged = true
Expand Down
4 changes: 2 additions & 2 deletions example/resource_virtual_environment_vm.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
locals {
datastore_id = "local-lvm"
datastore_id = var.virtual_environment_storage
}

resource "proxmox_virtual_environment_vm" "example_template" {
Expand Down Expand Up @@ -232,7 +232,7 @@ resource "proxmox_virtual_environment_vm" "data_vm" {
datastore_id = local.datastore_id
interface = "scsi0"
size = 8
import_from = proxmox_virtual_environment_download_file.latest_debian_12_bookworm_qcow2.id
import_from = proxmox_virtual_environment_download_file.latest_debian_12_bookworm_qcow2_img.id
}

disk {
Expand Down
12 changes: 12 additions & 0 deletions example/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ variable "virtual_environment_ssh_username" {
description = "The username for the Proxmox Virtual Environment API"
}

variable "virtual_environment_node_name" {
description = "Name of the Proxmox node"
type = string
default = "pve"
}

variable "virtual_environment_storage" {
description = "Name of the Proxmox storage"
type = string
default = "local-lvm"
}

variable "latest_debian_12_bookworm_qcow2_img_url" {
type = string
description = "The URL for the latest Debian 12 Bookworm qcow2 image"
Expand Down