infra/ansible/hosts
Graham McIntire f3f10c3e36
ansible: rewrite netbox role to match live netbox.vntx.net (bare-metal install)
The previous role was netbox-community/netbox-docker (compose-based) but
the live host runs the upstream tarball install directly: system Postgres
17, system Redis 8, gunicorn under systemd, and Caddy reverse-proxy.
Re-running the old role would have torn the working install down.

This rewrite mirrors what's actually deployed:

- defaults: NetBox 4.6.0, /opt/netbox layout, gunicorn 5w/3t/120s, all
  configuration.py knobs exposed as ansible vars.
- tasks: install OS deps, ensure netbox user, create Postgres role + db,
  download + extract release tarball, run upgrade.sh, render
  configuration.py / gunicorn.py / systemd units, enable services.
- templates: configuration.py.j2 covers the same keys the live file sets;
  netbox.service / netbox-rq.service are byte-equivalent to the live
  units (modulo paths driven by the install-dir var).
- caddy role gets a per-host Caddyfile-netbox.vntx.net.j2 mirroring the
  live vhost (25MB body limit, /static/* file_server, reverse_proxy to
  127.0.0.1:8001).
- inventory: new netbox_servers group; netbox.vntx.net added to
  caddy_servers so the per-host Caddyfile is wired up.
- host_vars/netbox.vntx.net.yml: secrets reference vault_* vars; role
  refuses to render config.py until they're set.

Operator action: create host_vars/netbox.vntx.net/vault.yml with
netbox_secret_key, netbox_db_password, and netbox_api_token_peppers
(value visible via `sudo cat /opt/netbox/netbox/netbox/configuration.py`
on the live host). See roles/netbox/README.md.
2026-05-08 12:17:30 -05:00

75 lines
1.2 KiB
INI
Executable file

[vntx_servers]
logs.vntx.net
radius.vntx.net
vpn.vntx.net
netbox.vntx.net
#ntp.vntx.net
unimus.vntx.net
monitor.vntx.net
librenms.vntx.net
uisp.vntx.net
[librenms_servers]
librenms.vntx.net
[resolvers]
resolver1.vntx.net
resolver2.vntx.net
[monitoring_servers]
monitor.vntx.net
[home_servers]
skippy.w5isp.com
mail.mcintire.me ansible_host=mail
dokku.w5isp.com
aprs.w5isp.com
staging.towerops.net
prom.w5isp.com ansible_host=10.0.15.31
[prometheus_servers]
prom.w5isp.com
[node_exporter_servers:children]
prometheus_servers
[dokku_servers]
staging.towerops.net
[aprsc_servers]
aprs.w5isp.com
[caddy_servers]
skippy.w5isp.com
netbox.vntx.net
[netbox_servers]
netbox.vntx.net
[bind9_servers]
ns1.as393837.net ansible_host=204.110.191.222
git.mcintire.me ansible_host=git
[dns_servers:children]
bind9_servers
[forgejo_servers]
git.mcintire.me
[uisp_servers]
uisp.vntx.net
[proxmox_servers]
vm1-380 ansible_host=10.0.0.1
vm2-380 ansible_host=vm2-380
node1 ansible_host=node1
node2 ansible_host=node2
node3 ansible_host=node3
[postgresql_servers]
db.towerops.net ansible_host=db-towerops
db.aprs.me ansible_host=10.0.15.22
[home_cluster:children]
proxmox_servers
postgresql_servers