From 757b191376405b5cea41b229cda165ac70b3a490 Mon Sep 17 00:00:00 2001 From: "Shawn M. Hanes" Date: Wed, 30 Jul 2025 20:48:32 -0400 Subject: [PATCH] chore(example): apply consistency in example/*.tf node_name declarations (#2051) * chore(example): apply consistency in example/*.tf node_name declarations Signed-off-by: Shawn M. Hanes * chore: reformat .tf files Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> --------- Signed-off-by: Shawn M. Hanes Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> Co-authored-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com> --- example/main.tf | 6 +-- .../resource_virtual_environment_container.tf | 4 +- ...ource_virtual_environment_download_file.tf | 4 +- example/variables.tf | 37 +++++++++++++++---- 4 files changed, 36 insertions(+), 15 deletions(-) diff --git a/example/main.tf b/example/main.tf index 4265ee33..b95b4f83 100644 --- a/example/main.tf +++ b/example/main.tf @@ -1,9 +1,9 @@ provider "proxmox" { - endpoint = var.virtual_environment_endpoint + endpoint = var.virtual_environment_endpoint api_token = var.virtual_environment_api_token - insecure = true + insecure = true ssh { - agent = true + agent = true username = var.virtual_environment_ssh_username } } diff --git a/example/resource_virtual_environment_container.tf b/example/resource_virtual_environment_container.tf index c244f306..3ebb9d93 100644 --- a/example/resource_virtual_environment_container.tf +++ b/example/resource_virtual_environment_container.tf @@ -42,7 +42,7 @@ resource "proxmox_virtual_environment_container" "example_template" { node_name = data.proxmox_virtual_environment_nodes.example.names[0] operating_system { - template_file_id = proxmox_virtual_environment_download_file.release_20250610_ubuntu_24_noble_lxc_img.id + template_file_id = proxmox_virtual_environment_download_file.release_20250701_ubuntu_24_10_lxc_img.id type = "ubuntu" } @@ -87,7 +87,7 @@ resource "proxmox_virtual_environment_container" "example" { pool_id = proxmox_virtual_environment_pool.example.id # Set the protection flag to prevent the deletion/update operations for the container and its disks. # protection = true - vm_id = 2043 + vm_id = 2043 } output "resource_proxmox_virtual_environment_container_example_id" { diff --git a/example/resource_virtual_environment_download_file.tf b/example/resource_virtual_environment_download_file.tf index 99405d11..ae5ec760 100644 --- a/example/resource_virtual_environment_download_file.tf +++ b/example/resource_virtual_environment_download_file.tf @@ -3,7 +3,7 @@ resource "proxmox_virtual_environment_download_file" "release_20250701_ubuntu_24_10_lxc_img" { content_type = "vztmpl" datastore_id = "local" - node_name = var.virtual_environment_node_name + node_name = data.proxmox_virtual_environment_nodes.example.names[0] url = var.release_20250701_ubuntu_24_10_lxc_img_url checksum = var.release_20250701_ubuntu_24_10_lxc_img_checksum checksum_algorithm = "sha256" @@ -15,7 +15,7 @@ resource "proxmox_virtual_environment_download_file" "latest_debian_12_bookworm_ content_type = "import" datastore_id = "local" file_name = "debian-12-generic-amd64.qcow2" - node_name = var.virtual_environment_node_name + node_name = data.proxmox_virtual_environment_nodes.example.names[0] url = var.latest_debian_12_bookworm_qcow2_img_url overwrite = true overwrite_unmanaged = true diff --git a/example/variables.tf b/example/variables.tf index 331411db..254f7933 100644 --- a/example/variables.tf +++ b/example/variables.tf @@ -1,44 +1,65 @@ variable "virtual_environment_endpoint" { - type = string description = "The endpoint for the Proxmox Virtual Environment API (example: https://host:port)" + type = string +} + +variable "virtual_environment_username" { + description = "Proxmox User for API Access" + type = string + default = "root@pam" +} + +variable "virtual_environment_password" { + description = "Password for Proxmox API User" + type = string + sensitive = true + default = "don not use default passwords!" } variable "virtual_environment_api_token" { - type = string description = "The API token for the Proxmox Virtual Environment API" + type = string + sensitive = true } variable "virtual_environment_ssh_username" { - type = string description = "The username for the Proxmox Virtual Environment API" + type = string + default = "root" } variable "virtual_environment_node_name" { description = "Name of the Proxmox node" type = string - default = "pve" + default = "pve" +} + +variable "virtual_environment_insecure" { + description = "Self Signed Certificates Used" + type = bool + default = true } variable "virtual_environment_storage" { description = "Name of the Proxmox storage" type = string - default = "local-lvm" + default = "local-lvm" } variable "latest_debian_12_bookworm_qcow2_img_url" { - type = string description = "The URL for the latest Debian 12 Bookworm qcow2 image" + type = string default = "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2" } variable "release_20250701_ubuntu_24_10_lxc_img_url" { - type = string description = "The URL for the Ubuntu 24.10 LXC image" + type = string default = "https://mirrors.servercentral.com/ubuntu-cloud-images/releases/24.10/release-20250701/ubuntu-24.10-server-cloudimg-amd64-root.tar.xz" } variable "release_20250701_ubuntu_24_10_lxc_img_checksum" { - type = string description = "The checksum for the Ubuntu 24.10 LXC image" + type = string default = "6caa4e90e4c2ae33d3fff0526c75cfc3d221e0c1ccd49d01229a44776af126d1" }