Files
Terraform/wikmd.tf
2025-11-04 00:23:58 -06:00

62 lines
1.3 KiB
HCL

variable "ip" {
description = "Ip address of vm"
type = string
default = "192.168.0.56" # Optional: A default value
}
variable "hostname" {
description = "wikmd"
type = string
default = "t2.micro" # Optional: A default value
}
variable "flask_token" {
type = string
}
resource "proxmox_lxc" "wikmd" {
target_node = "ryuk"
hostname = "wikmd"
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.host}/${var.ip} -H "Authorization: Bearer ${flask_token}"'
}
}