Project

General

Profile

Actions

Bug #3802

closed

Provision Vectra application LXC with nginx via LoopAware IaC

Added by Fredrick Amnehagen about 6 hours ago. Updated about 6 hours ago.

Status:
Done
Priority:
High
Target version:
-
Start date:
2026-11-30
Due date:
% Done:

100%

Estimated time:
Spent time:

Description

Value: Vectra web app runs inside a managed LXC with nginx, replacing the host-level deployment and the invalid duplicate 10.32.71.27 allocation.

Acceptance criteria:

  • Authoritative IPAM state and DHCP reservations are repaired; the erroneous vectra allocation on 10.32.71.27 (already owned by ouroboros) is released and the ouroboros DHCP reservation restored via la-infra-cli.
  • A fresh IP is allocated with 'la-infra-cli ip next-free' using the canonical cred config, with full all-node static-LXC/DHCP scan and --verify.
  • OpenTofu definitions and Ansible playbooks/Jinja2 templates in Vectra/infra describe the LXC, nginx site, systemd unit and app deployment; wrapper script uses the infra SDK/CLI only.
  • LXC is created via the LoopAware SDK-backed path, nginx + FastAPI run inside it, and end-to-end ingress/health is verified.

MoSCoW: M. Points: 5. Dependencies: #3793, #3796, #3798, #3799, #3800, #3801.

Tracking: Forgejo Vectra/infra. All infra ops serialized in this issue.

Actions #1

Updated by Fredrick Amnehagen about 6 hours ago

  • Status changed from To do to In Progress
  • Assignee set to Fredrick Amnehagen

Claimed by fredrick. Starting IPAM repair; using INFRA_CONFIG=/home/fredrick/cred/dynamic-infra.yaml (canonical cred config) instead of the hand-written config from the previous session. Infrastructure operations serialized here.

Actions #2

Updated by Fredrick Amnehagen about 6 hours ago

  • % Done changed from 0 to 100

Provisioning complete and verified end to end.

IPAM integrity: authoritative /var/lib/infra/ipam/ip_metadata.json on la-vmh-12 showed 10.32.71.27 was already allocated to ouroboros on 2026-06-03; the 2026-11-30 vectra allocation was a duplicate. Released it with la-infra-cli ip release 10.32.71.27 --state-node la-vmh-12, then restored the ouroboros DHCP reservation (02:9f:44:cc:c3:de) with la-infra-cli dns add-host / dns update-host. Fresh allocation: 10.32.71.153 via ip next-free --project vectra --owner fredrick@loopaware.com --domain vectra.loopaware.com --vmid 12140 --node la-vmh-07 --state-node la-vmh-12 --verify, metadata fixed with ip update.

Target node: la-vmh-07 (VMID 12140) is a deliberate exception to the generic production-on-la-vmh-12 rule: the Tesla M40 and local-backup storage are on la-vmh-07. The CLI next-vmid returned 108, which is already used cluster-wide on la-vmh-12/la-vmh-13, so 12140 was selected by an all-node guest scan.

IaC: OpenTofu module in infra/tofu (pinned bpg/proxmox 0.90.0) creates the Debian 13 LXC; Ansible role infra/ansible/roles/vectra_app renders nginx/systemd/env from Jinja2 and deploys the app; infra/scripts/env.sh reads secrets only from ~/cred/dynamic-infra.yaml; infra/scripts/provision-vectra-lxc.sh and verify-vectra.sh wrap CLI/tofu/Ansible. nginx is explicitly reloaded after site enable because the LXC can boot nginx before Ansible renders the site.

Evidence (2026-11-30 13:22 UTC):

  • la-infra-cli ip status 10.32.71.153 -> Status: allocated; 10.32.71.27 -> Status: released.
  • DHCP: 10.32.71.153 -> BC:24:11:F1:8D:E5 (la-vectra-01.fe.loopaware.com); 10.32.71.27 restored to ouroboros.
  • LXC 12140: status running, net0 ip=10.32.71.153/16, onboot=1; tofu state list shows the managed resource and tofu plan reports no changes.
  • In LXC: systemctl is-active vectra nginx -> active/active; curl http://127.0.0.1:8080/healthz -> {"status":"ok","gpu_lock":true}; nginx -t passes.
  • From estate: curl http://10.32.71.153/healthz -> {"status":"ok","gpu_lock":true}; curl -sSI http://10.32.71.153/ -> 302 to Authelia.
  • Ingress: la-infra-cli ingress list has vectra.loopaware.com -> 10.32.71.153:80; curl -sSI https://vectra.loopaware.com/ -> 302 location https://authelia.loopaware.com/?target=https://vectra.loopaware.com/
  • bash infra/scripts/verify-vectra.sh -> [verify] PASS.

Time logged: 3.5h (entry #1691). Commit/PR link will be added after push.

Actions #3

Updated by Fredrick Amnehagen about 6 hours ago

  • Status changed from In Progress to Done

Implementation branch pushed as feature/3802-lxc-nginx; Forgejo PR: https://forgejo.loopaware.com/Vectra/meta/pulls/1 (PR #1, commit 1943fe9). Verification was performed before opening the PR and passed. Closing this issue as the LXC + nginx service are live and verified; review/release continues in Forgejo PR #1.

Actions

Also available in: Atom PDF