2026-07-20 18:19:45 -07:00
|
|
|
# Outputs feed the run-test.sh wrapper (jq consumes `terraform output -json`)
|
|
|
|
|
# and give the operator sane next-step hints after `apply`.
|
|
|
|
|
|
|
|
|
|
output "store_vm_ip" {
|
|
|
|
|
description = "IPv4 the store VM will be reachable on."
|
|
|
|
|
value = var.store_vm_ip_cidr != "" ? split("/", var.store_vm_ip_cidr)[0] : (
|
|
|
|
|
length(proxmox_virtual_environment_vm.store.ipv4_addresses) > 1 ?
|
2026-07-20 18:33:39 -07:00
|
|
|
proxmox_virtual_environment_vm.store.ipv4_addresses[1][0] : ""
|
2026-07-20 18:19:45 -07:00
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
output "bmpgen_vm_ip" {
|
|
|
|
|
description = "IPv4 the bmpgen VM will be reachable on."
|
|
|
|
|
value = var.bmpgen_vm_ip_cidr != "" ? split("/", var.bmpgen_vm_ip_cidr)[0] : (
|
|
|
|
|
length(proxmox_virtual_environment_vm.bmpgen.ipv4_addresses) > 1 ?
|
2026-07-20 18:33:39 -07:00
|
|
|
proxmox_virtual_environment_vm.bmpgen.ipv4_addresses[1][0] : ""
|
2026-07-20 18:19:45 -07:00
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
output "ssh_username" {
|
|
|
|
|
description = "SSH username cloud-init provisioned on both VMs."
|
|
|
|
|
value = var.ssh_username
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
output "grafana_url" {
|
|
|
|
|
description = "Grafana URL once deploy.sh finishes on the store VM."
|
|
|
|
|
value = format("http://%s:3000/grafana/",
|
|
|
|
|
var.store_vm_ip_cidr != "" ? split("/", var.store_vm_ip_cidr)[0] : "<store_ip>"
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
output "next_steps" {
|
|
|
|
|
description = "What to do after apply."
|
2026-07-20 18:33:39 -07:00
|
|
|
value = <<-EOT
|
2026-07-20 18:19:45 -07:00
|
|
|
Cloud-init on both VMs runs for ~5-10 minutes after apply completes.
|
|
|
|
|
Poll the store VM until it's up, then run the assertions:
|
|
|
|
|
|
|
|
|
|
../scripts/run-test.sh
|
|
|
|
|
|
|
|
|
|
To iterate on the terraform without rebuilding the VMs:
|
|
|
|
|
|
|
|
|
|
terraform apply -target=proxmox_virtual_environment_file.store_cloud_init
|
|
|
|
|
# then reset the VM: qm shutdown <vmid> && qm start <vmid>
|
|
|
|
|
# (cloud-init re-runs the snippet at next boot only if you touch it)
|
|
|
|
|
|
|
|
|
|
To tear down:
|
|
|
|
|
|
|
|
|
|
../scripts/teardown.sh
|
|
|
|
|
EOT
|
|
|
|
|
}
|