Add comments to describe the code

This commit is contained in:
2025-05-27 20:42:23 +00:00
parent a7491df751
commit 22f6403417
3 changed files with 65 additions and 46 deletions

View File

@@ -1,18 +1,22 @@
# Define the required Terraform provider block
terraform {
required_providers {
proxmox = {
source = "bpg/proxmox"
source = "bpg/proxmox" # Use the community Proxmox provider from the bpg namespace
}
}
}
# Configure the Proxmox provider with API and SSH access
provider "proxmox" {
endpoint = var.proxmox_endpoint
api_token = var.proxmox_api_token
insecure = false
endpoint = var.proxmox_endpoint # Proxmox API URL (e.g., https://proxmox.local:8006/api2/json)
api_token = var.proxmox_api_token # API token for authentication (should have appropriate permissions)
insecure = false # Reject self-signed or invalid TLS certificates (set to true only in trusted/test environments)
# Optional SSH settings used for VM customization via SSH
ssh {
agent = false
private_key = file("~/.ssh/id_ed25519")
username = "root"
agent = false # Do not use the local SSH agent; use key file instead
private_key = file("~/.ssh/id_ed25519") # Load SSH private key from the local file system
username = "root" # SSH username for connecting to the Proxmox host
}
}
}