Ansible automation for a fleet of Remnawave VPN nodes: provision a bare VPS, harden it, stand up Xray with VLESS + XHTTP + REALITY behind a decoy website, register everything with the panel, and keep the whole fleet reconciled from one place.
It ran a small production fleet for a couple of years. It is opinionated — every playbook is idempotent, every rollout goes through a canary first, and almost nothing is done by hand.
| Provision | One command from a fresh VPS to a registered, serving node: users, SSH keys, hardening, Docker, BBR, swap, UFW, fail2ban. |
| Serve | Xray (remnanode) with VLESS + XHTTP + REALITY, fronted by an Angie web server that demultiplexes TCP/443 by SNI and ALPN. Wrong-SNI traffic gets a real, plausible website. |
| Register | Reconciles config profiles, node registration, host entries and squads against the Remnawave panel API. Reality keys are generated once and preserved across runs. |
| Deliver | Optional subscription relay: nodes can front the subscription origin so clients never resolve the panel. |
| Observe | Prometheus agent per node, remote-writing to your Prometheus, plus a fleet alert rule set. |
| Egress | Optional Cloudflare WARP egress for a configurable domain list. |
| Retire | decommission.yml unwinds a node from the panel, DNS, and your inventory. |
git clone https://github.com/<you>/remnawave-vpn-ansible.git cd remnawave-vpn-ansible cp -r inventory.example inventory cp inventory/group_vars/all/vault.yml.example inventory/group_vars/all/vault.yml $EDITOR inventory/group_vars/all/vars.yml # domains, panel URL, SSH keys $EDITOR inventory/group_vars/all/vault.yml # API tokens ansible-vault encrypt inventory/group_vars/all/vault.yml ./new-node aurora 203.0.113.10 HEL FI 🇫🇮 Helsinki ./provision aurora key
inventory/ is gitignored — your real fleet never lands in this repo. See
docs/getting-started.md for the full walkthrough.
- Getting started — prerequisites, first node, what to expect.
- Architecture — how a request reaches Xray, and why the decoy site exists.
- Inventory reference — every variable, what it controls, what validation enforces.
- Secrets — the vault, what is in it, how to rotate it.
- Operations — the playbook catalogue and the canary-first rollout discipline.
- Subscription relay — DNS, certificates, and the smoke check.
- CI — the lint lane everyone gets, and the optional ops lanes.
- A Remnawave panel you administer, and an API token.
- Debian 12 (bookworm) nodes with root or a sudo-capable bootstrap user.
- Docker on your workstation —
./ansible-runexecutes everything in a pinned toolchain image, so the only thing you install locally is Docker. Or setVPN_ANSIBLE_HOSTED=trueand use your ownansible-core2.21. - A Cloudflare-hosted zone, if you want managed DNS or the subscription relay.
ansible-run run any ansible command in the pinned toolchain image
provision bare VPS -> fully configured, registered node
new-node scaffold a host_vars file with validated fields
deploy canary -> verify -> prompt -> fleet
codenames.yml the node-name ledger
inventory.example/ template inventory; copy to inventory/
playbooks/ one playbook per concern; _-prefixed ones are includes
roles/ common, selfsteal, warp, prometheus_agent/_rules, remnawave_panel
templates/ mihomo subscription templates pushed to the panel (see its README)
tests/ render-and-validate checks that run in CI
Archived-but-working: the fleet it managed has been shut down, so it is published as-is under the MIT licence for anyone who wants to run the same shape of infrastructure. Pinned image digests and upstream API expectations are frozen at the time of the last production run — read docs/operations.md before pointing it at live users.
The mihomo subscription templates in templates/ are based on the configs and
routing rules published by
Davoyan/mihomo-rule-sets, and
load rule sets at runtime from that project,
MetaCubeX/meta-rules-dat,
legiz-ru/mihomo-rule-sets and
itdoginfo/allow-domains. See
templates/README.md for the per-source breakdown.
Built on Remnawave, Xray-core, mihomo and Angie.
MIT for the automation in this repo. The referenced rule sets are not vendored here and remain under their own terms — see above.