new test vm for creation process.

This commit is contained in:
tolerryan
2025-11-04 00:33:00 -06:00
parent 18f7f8f83c
commit 798037615a
2 changed files with 63 additions and 4 deletions

60
testvm.tf Normal file
View File

@@ -0,0 +1,60 @@
variable "ip" {
description = "Ip address of vm"
type = string
default = "192.168.0.64" # Optional: A default value
}
variable "hostname" {
description = "test2"
type = string
default = "t2.micro" # Optional: A default value
}
variable "flask_token" {
type = string
}
resource "proxmox_lxc" var.hostname {
target_node = "ryuk"
hostname = var.hostname
vmid = 217
ostemplate = "cephfs:vztmpl/debian-13-standard_13.1-2_amd64.tar.zst"
password = "terraform"
unprivileged = true
cores = 5
memory = 4096
swap = 1024
start = true
tags = "terraform;deb13"
nameserver = "192.168.0.224"
ssh_public_keys = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINFw70PrMsilcsqCrwW1I6PAt3anQbhmVg+t/HUfomug ryan@mxDesktop"
features {
nesting = true
}
rootfs {
storage = "local-lvm"
size = "32G"
}
mountpoint{
key = "0"
slot = 0
storage = "CephSSD"
mp = "/data"
size = "400G"
}
network {
name = "eth0"
bridge = "vmbr0"
ip = "${var.ip}/24"
gw = "192.168.0.1"
}
provisioner "local-exec" {
command = "curl -k -X POST https://192.168.0.143:5000/setupansible/${var.hostname}/${var.ip} -H \"Authorization: Bearer ${var.flask_token}\""
}
}