fix: clean up Vectra IaC drift, add tests and usage docs #2

Open
fredrick wants to merge 3 commits from feature/3803-iac-cleanup-tests into main
Owner

Redmine: https://redmine.loopaware.com/issues/3803 (Refs #3803). Follow-up to PR #1 / #3802.

Changes:

  • Deleted stale static configs from 00cbe05 (vectra.env.template, networking/nginx/vectra.conf, servers/la-vmh-07-vectra.yml, systemd/vectra.service); Ansible-rendered templates are now the single source of truth.
  • Fixed HF_HOME=/opt/vectra/models plus systemd ReadWritePaths; pinned Python deps; portable Ansible inventory; nginx body limit 26 MB so app validation is returned.
  • Hardened scripts: config-driven creds/nodes, JSON parsed instead of shell hacks, real verification assertions, and a guard against creating a duplicate LXC when local OpenTofu state is missing.
  • Added offline IaC tests plus opt-in live tests: bash infra/scripts/test.sh (10 passed, 2 skipped) and VECTRA_LIVE_TESTS=1 bash infra/scripts/test.sh (12 passed) after re-running the provision wrapper (verify PASS).
  • Added infra/README.md usage guide; corrected ROADMAP/AGENTS/SKILLS claims about Authelia.

Known gap: dedicated vectra-users Authelia rules are not deployed; tracked in #3804. The nginx 403 text no longer claims a group restriction that does not exist.

Redmine: https://redmine.loopaware.com/issues/3803 (Refs #3803). Follow-up to PR #1 / #3802. Changes: - Deleted stale static configs from 00cbe05 (vectra.env.template, networking/nginx/vectra.conf, servers/la-vmh-07-vectra.yml, systemd/vectra.service); Ansible-rendered templates are now the single source of truth. - Fixed HF_HOME=/opt/vectra/models plus systemd ReadWritePaths; pinned Python deps; portable Ansible inventory; nginx body limit 26 MB so app validation is returned. - Hardened scripts: config-driven creds/nodes, JSON parsed instead of shell hacks, real verification assertions, and a guard against creating a duplicate LXC when local OpenTofu state is missing. - Added offline IaC tests plus opt-in live tests: bash infra/scripts/test.sh (10 passed, 2 skipped) and VECTRA_LIVE_TESTS=1 bash infra/scripts/test.sh (12 passed) after re-running the provision wrapper (verify PASS). - Added infra/README.md usage guide; corrected ROADMAP/AGENTS/SKILLS claims about Authelia. Known gap: dedicated vectra-users Authelia rules are not deployed; tracked in #3804. The nginx 403 text no longer claims a group restriction that does not exist.
Provision VMID 12140 (la-vectra-01, 10.32.71.153) on la-vmh-07 through
OpenTofu, deploy FastAPI + nginx through Ansible/Jinja2, and register the
ingress through la-infra-cli. Repair the duplicate 10.32.71.27 IPAM
allocation and restore the ouroboros DHCP reservation.

Refs #3802
- Remove stale static configs from 00cbe05 that drifted from Ansible-rendered nginx/systemd/env files.
- Set HF_HOME to /opt/vectra/models and allow systemd writes there; pin Python deps; make inventory portable.
- Harden env.sh/provision/verify scripts: configurable nodes, JSON parsing, real assertions, duplicate-LXC state guard.
- Add offline IaC tests plus opt-in live tests (infra/scripts/test.sh) and infra/README.md usage guide.
- Correct ROADMAP/AGENTS/SKILLS claims about Authelia vectra-users rules (tracked in #3804).

Refs #3803
- Add offline suites for env.sh failure modes, script hygiene, template semantics, OpenTofu safety settings and cross-file consistency.
- Add live drift tests for rendered files, effective nginx config, systemd hardening, pinned dependencies, DHCP/MAC agreement, IPAM metadata, auth boundary and the app upload contract.
- Fix env.sh swallowing credential lookup failures; harden verify with protocol-neutral status matching, DHCP hostname, nginx site, Authelia backend and internal-endpoint checks; hide nginx version.
- Offline: 41 passed, 14 live skipped. Live: 55 passed after re-applying Ansible and verify PASS.

Refs #3805
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature/3803-iac-cleanup-tests:feature/3803-iac-cleanup-tests
git switch feature/3803-iac-cleanup-tests

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff feature/3803-iac-cleanup-tests
git switch feature/3803-iac-cleanup-tests
git rebase main
git switch main
git merge --ff-only feature/3803-iac-cleanup-tests
git switch feature/3803-iac-cleanup-tests
git rebase main
git switch main
git merge --no-ff feature/3803-iac-cleanup-tests
git switch main
git merge --squash feature/3803-iac-cleanup-tests
git switch main
git merge --ff-only feature/3803-iac-cleanup-tests
git switch main
git merge feature/3803-iac-cleanup-tests
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Vectra/meta!2
No description provided.