sam d30ec2074a initial commit: two-VM Proxmox portability test for obmp-docker
Terraform (bpg/proxmox) provisions two Ubuntu 24.04 cloud-init VMs on a
Proxmox host, one running obmp-docker's `deploy.sh --scope full-stack`
and the other running GoBGP as a BMP-source stand-in. `scripts/run-test.sh`
runs the six assertions from docs/design.md (containers healthy, BMP
peer up, ip_rib/bgp_peers non-zero, Grafana healthcheck).

Layout:
  terraform/            provider + VM + cloud-init snippet resources
  terraform/cloud-init/ user-data templates (store + bmpgen)
  scripts/              run-test.sh, teardown.sh
  docs/design.md        topology, assertion set, and rationale

Cred handling:
  terraform.tfvars is gitignored; endpoint + api_token can also come
  from PROXMOX_VE_ENDPOINT / PROXMOX_VE_API_TOKEN env vars.

Not validated locally: `terraform init && terraform validate` -- the
terraform binary is not on the authoring host. YAML + shell + HCL brace
balance verified.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-07-20 18:19:45 -07:00

26 lines
832 B
Bash
Executable File

#!/usr/bin/env bash
#
# teardown.sh -- destroy the two test VMs. Cloud image + snippet files
# stay in PVE storage so the next `terraform apply` is fast.
set -euo pipefail
cd "$(dirname "$0")/../terraform"
if ! command -v terraform >/dev/null; then
echo "terraform not installed on this host" >&2
exit 2
fi
# Destroy only the VMs, keep the cached cloud image + snippets so the
# next apply doesn't re-download. `terraform destroy` with -target lists
# is fine because everything else is either downloaded content (image)
# or a snippet file (cheap to re-create).
terraform destroy \
-target=proxmox_virtual_environment_vm.store \
-target=proxmox_virtual_environment_vm.bmpgen \
-auto-approve
echo
echo "VMs destroyed. To also drop the cached image + snippets:"
echo " terraform destroy (without -target)"