Files
infrastructure/proxmox/lxc/ct-103-reverse-proxy/ansible
spektr 8ef591b4a0 GNAI-023 M8-T4 Fix: Report-Download (PDF via weasyprint, /outputs-Routing im NPM)
'No pdf path provided': md2pdf im gptr-Image braucht playwright/chromium
(nicht installiert) -> write_md_to_pdf faellt auf '' zurueck. sitecustomize
ersetzt sie durch weasyprint (im Image funktionsfaehig). docx-404: NPM-vHost
leitete /outputs/ an den Frontend-Container; neue location /outputs/ mit
auth_request + Proxy auf Backend :8086 + rewrite gegen das vom Frontend
verdoppelte outputs/outputs/-PREFIX. Verifiziert: PDF wird erzeugt,
nginx -t ok, unauth /outputs -> 302 Keycloak, beide Playbooks idempotent.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-11-21 11:44:13 +01:00
..

CT 103 reverse proxy Ansible project

This self-contained host project manages the production reverse proxy LXC (CT 103, reverse-proxy, 10.0.0.10: Nginx Proxy Manager, Fail2Ban, nftables). It follows the CT 100 Pi-hole and CT 101 Samba project schema, uses the repository-wide pinned control dependency and the shared podman_runtime role, while all CT 103 inventories, playbooks, keys and service roles remain inside the CT 103 root.

Create the repository-level control environment once:

python3 -m venv .venv
.venv/bin/python -m pip install --upgrade pip
.venv/bin/python -m pip install -r shared/ansible/requirements-control.txt

Run commands from this directory and always select an inventory explicitly:

cd proxmox/lxc/ct-103-reverse-proxy/ansible
../../../../.venv/bin/ansible-playbook \
  --inventory inventories/agent/hosts.yml \
  playbooks/preflight.yml \
  --private-key ~/.ssh/id_ed25519_ghostnet_ct103_agent

Adoption sequence for the pre-Ansible CT 103

The LXC was hardened and accepted before this project existed (GNAI-006). The adoption path mirrors CT 100 and keeps the production proxy intact:

  1. preflight.yml on the agent inventory (read-only, unprivileged, --private-key ~/.ssh/id_ed25519_ghostnet_ct103_agent) proves identity, service health, listeners and the local NPM admin answer.
  2. audit-production.yml on the bootstrap inventory (read-only, become through ghost, --ask-become-pass) deep-audits the root-only state and reports the known drifts instead of failing on them.
  3. bootstrap.yml on the bootstrap inventory adopts the ansible-deploy account, the NOPASSWD sudo policy and the unified SSH drop-in; keep a second session or the Proxmox console open while SSH policy changes are applied.
  4. verify-deploy-access.yml on the production inventory proves the new deployment boundary (--private-key ~/.ssh/id_ed25519_ghostnet_ct103_ansible_deploy).
  5. site.yml --check --diff on the production inventory previews the convergence. Expected changes: the SSH drop-in gains AllowUsers ansible-deploy, AllowStreamLocalForwarding no and DisableForwarding yes; SSH socket activation is replaced by the classic ssh.service; /etc/nftables.conf is rewritten with the managed marker (identical rules); the two stale Quadlet backups are removed.
  6. site.yml converges; verify-production.yml plus a second site.yml --check run with changed=0 complete the adoption.

The production verifier is read-only. A real site.yml run enforces the declared state and therefore requires an explicit change authorization.

Declared scope and deliberate non-goals

  • NPM runtime data (SQLite database, keys, Let's Encrypt certificates, proxy hosts), the Fail2Ban configuration tree and ban database, and the NPM admin password are backup-restored runtime artifacts. They are never created, read or transported by these playbooks.
  • postfix.service is present on the host but outside the GNAI-006 declared state; this project neither installs nor removes it. The operator decides whether to retire it.
  • The functional Fail2Ban acceptance (GNAI-006 section 12) stays an operator-run procedure; this project only pins the quadlet, jails and filters.
  • Do not store secret contents, private SSH keys or NPM access-log data in this repository.