feat: rework terraform pve_vm module

This commit is contained in:
2025-07-02 07:15:55 +00:00
parent a78860c3b8
commit c524868cf5
6 changed files with 26 additions and 20 deletions

View File

@@ -90,4 +90,3 @@ output "vm_ip" {
value = proxmox_virtual_environment_vm.vm.ipv4_addresses[1][0]
description = "VM IP"
}

View File

@@ -5,3 +5,14 @@ terraform {
}
}
}
provider "proxmox" {
endpoint = var.proxmox_endpoint
api_token = var.proxmox_api_token
insecure = false
ssh {
agent = false
private_key = file("~/.ssh/id_ed25519")
username = "root"
}
}

View File

@@ -1,3 +1,15 @@
variable "proxmox_endpoint" {
description = "Proxmox URL endpoint"
type = string
}
variable "proxmox_api_token" {
description = "Proxmox API token"
type = string
sensitive = true
}
variable "node_name" {
description = "Proxmox host for the VM"
type = string

View File

@@ -5,6 +5,8 @@ module "pve_vm" {
vm_cpu = 2
vm_ram = 2048
vm_vlan = 66
proxmox_endpoint = var.proxmox_endpoint
proxmox_api_token = var.proxmox_api_token
}
output "vm_ip" {

View File

@@ -1,18 +0,0 @@
terraform {
required_providers {
proxmox = {
source = "bpg/proxmox"
}
}
}
provider "proxmox" {
endpoint = var.proxmox_endpoint
api_token = var.proxmox_api_token
insecure = false
ssh {
agent = false
private_key = file("~/.ssh/id_ed25519")
username = "root"
}
}

View File

@@ -7,4 +7,4 @@ variable "proxmox_api_token" {
description = "Proxmox API token"
type = string
sensitive = true
}
}