0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-08-22 11:28:33 +00:00

chore(tests): allow different node / storage names in "example tests" (#2042)

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
Signed-off-by: MacherelR <64424331+MacherelR@users.noreply.github.com>
Co-authored-by: MacherelR <64424331+MacherelR@users.noreply.github.com>
This commit is contained in:
Pavel Boldyrev 2025-07-14 19:56:23 -04:00 committed by GitHub
parent e9fcd6b4cb
commit 09e3cd62b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 17 deletions

View File

@ -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"
}
@ -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 {

View File

@ -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"
@ -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

View File

@ -1,5 +1,5 @@
locals {
datastore_id = "local-lvm"
datastore_id = var.virtual_environment_storage
}
resource "proxmox_virtual_environment_vm" "example_template" {
@ -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 {

View File

@ -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"