From c175979ae2383524c3dbe6f19686c5b0b81bcc90 Mon Sep 17 00:00:00 2001 From: tolerryan <105945216+tolerryan@users.noreply.github.com> Date: Tue, 4 Nov 2025 00:16:34 -0600 Subject: [PATCH] Test change setup to api --- wikmd.tf | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/wikmd.tf b/wikmd.tf index 5be0ddd..9a1f437 100644 --- a/wikmd.tf +++ b/wikmd.tf @@ -1,3 +1,19 @@ +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" @@ -34,16 +50,13 @@ resource "proxmox_lxc" "wikmd" { network { name = "eth0" bridge = "vmbr0" - ip = "192.168.0.56/24" + ip = "${var.ip}/24" gw = "192.168.0.1" - } + provisioner "local-exec" { - command = "./.ansible.d/setup.sh $IP" - environment = { - IP = "192.168.0.56" - } + command = "curl -k -X POST https://localhost:5000/setupansible/${var.host}/${var.ip} -H "Authorization: Bearer ${flask_token}" } }