feat: rework terraform pve_vm module
This commit is contained in:
@@ -90,4 +90,3 @@ output "vm_ip" {
|
|||||||
value = proxmox_virtual_environment_vm.vm.ipv4_addresses[1][0]
|
value = proxmox_virtual_environment_vm.vm.ipv4_addresses[1][0]
|
||||||
description = "VM IP"
|
description = "VM IP"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -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" {
|
variable "node_name" {
|
||||||
description = "Proxmox host for the VM"
|
description = "Proxmox host for the VM"
|
||||||
type = string
|
type = string
|
||||||
|
@@ -5,6 +5,8 @@ module "pve_vm" {
|
|||||||
vm_cpu = 2
|
vm_cpu = 2
|
||||||
vm_ram = 2048
|
vm_ram = 2048
|
||||||
vm_vlan = 66
|
vm_vlan = 66
|
||||||
|
proxmox_endpoint = var.proxmox_endpoint
|
||||||
|
proxmox_api_token = var.proxmox_api_token
|
||||||
}
|
}
|
||||||
|
|
||||||
output "vm_ip" {
|
output "vm_ip" {
|
||||||
|
@@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
@@ -7,4 +7,4 @@ variable "proxmox_api_token" {
|
|||||||
description = "Proxmox API token"
|
description = "Proxmox API token"
|
||||||
type = string
|
type = string
|
||||||
sensitive = true
|
sensitive = true
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user