Files
infrastructure/proxmox/lxc/ct-103-reverse-proxy/ansible
spektr eece53c7bb CT-103: Ansible-Nachbau fuer NPM/Fail2Ban (Adoption 07.11.2026)
Vollstaendiger CT-scoped Sollzustand fuer den Reverse-Proxy-LXC:
Konten/SSH-Drop-in (reverse_proxy_access), nftables (reverse_proxy_firewall),
NPM- und Fail2Ban-Quadlets inkl. Jails/Filter (reverse_proxy_npm,
reverse_proxy_fail2ban), LXC-Baseline sowie preflight/audit/bootstrap/
verify-deploy-access/site/verify-production-Playbooks fuer die Inventare
agent/bootstrap/production. NPM-Runtime-Daten (DB, Zertifikate, Proxyhosts)
bleiben bewusst aussen vor (Restore aus CT-Backup).

Verifiziert am 09.11.2026 gegen den Live-Host: preflight.yml (agent)
ok=15 failed=0; verify-production.yml (production) ok=27 changed=0 failed=0;
site.yml --check changed=0 (konvergent und idempotent). Host-Key-Fingerprint,
Hostname, Debian 13.7, 10.0.0.10, 2 vCPU/1024 MB matchen die Inventory-Safeguards.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-11-09 05:40:35 +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.