No description
  • Python 86.6%
  • Jinja 7.3%
  • Shell 6.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
iac-renovate 8c36f0c803
All checks were successful
/ lint (push) Successful in 18s
/ image (push) Successful in 19m54s
/ publish (push) Successful in 28s
Merge pull request 'Update netbox-community/netbox to v4.7.6' (#7) from renovate/netbox-community-netbox-4.x into main
2026-11-27 21:43:36 +01:00
.forgejo/workflows Pin upstream version 4.7.3 and sync the template 2026-10-18 23:08:19 +02:00
.vibe Add the agent pointer for Mistral Vibe 2026-10-15 12:23:51 +02:00
files Sandbox NetBox services, rate limit the login 2026-10-13 15:28:46 +02:00
handlers
roles/provisioner Add the field Availability target (iac_slo) to VMs 2026-11-19 11:59:01 +01:00
tasks Create a NetBox platform per guest OS for iac-provisioner 2026-11-05 23:30:41 +01:00
templates Refuse apps and modules a VM type does not have 2026-10-12 15:14:28 +02:00
tests
.clinerules
.cursorrules
.windsurfrules
AGENTS.md Name pve.sh as the only host management in AGENTS.md 2026-10-27 15:01:38 +01:00
CHANGELOG.md Add the field Availability target (iac_slo) to VMs 2026-11-19 11:59:01 +01:00
CLAUDE.md
GEMINI.md
iac.json Update netbox-community/netbox to v4.7.6 2026-11-27 19:43:33 +00:00
LICENSE Add MIT license 2026-11-14 17:17:07 +01:00
README.md Add the field Availability target (iac_slo) to VMs 2026-11-19 11:59:01 +01:00

iac-netbox

IP Address Management (IPAM) and Data Center Infrastructure Management (DCIM) with NetBox as an LXC container or VM on Proxmox VE. Part of iac.

Features

  • Repeatable Deployment: Powered by iac-core with automated setup of Python venv, PostgreSQL client libraries, Redis, and Gunicorn.
  • Clean Release Management: Versions are isolated in /opt/netbox-x.y.z/ and swapped atomically via /opt/netbox symlink.
  • Persistent Storage: Uploads (media), custom scripts (scripts), and reports (reports) reside safely outside the app directory in /var/lib/netbox/.
  • Web server: nginx serves the Web UI on port 8000 including the static files; Gunicorn only listens on 127.0.0.1:8001. Own nginx additions: /etc/nginx/conf.d/*.conf.
  • Automated Firewalling: Port 8000 (Web UI) is managed directly via iac.json.

Installation (on the Proxmox Node)

bash -c "$(curl -fsSL https://iac.heyer.systems/netbox/ct.sh)"   # LXC
bash -c "$(curl -fsSL https://iac.heyer.systems/netbox/vm.sh)"   # VM

For non-interactive automation, supply IAC_NONINTERACTIVE=1 along with var_* environment variables. The easiest way to generate these is through the web form at:

https://iac.heyer.systems/apps/netbox/

First login

User admin, the password is generated per instance – inside the guest:

grep netbox_admin_password /etc/iac/settings.env

The user is only created while NetBox has no superuser at all; change the password after the first login.

Custom Configuration

The primary configuration is managed by iac. Place your local customizations (such as a custom SECRET_KEY, database settings, or LDAP configurations) into the override file so they survive updates:

/etc/netbox/configuration.local.py

iac-provisioner

The module provisioner adds the NetBox schema that iac-provisioner needs: the tags iac-managed, iac-update-now, iac-security-report-now and iac-reboot-now, the custom fields iac_app, iac_type, iac_modules, iac_vmid, iac_settings, iac_firewall (virtual machines) and gateway (prefixes) and their choice sets, the read-only fields of the group "iac status" (app version, last update, configuration, settings, packages, CVEs, security report, reboot needed, services to restart), the field "Accepted risks" (group "compliance": residual risks iac-compliance reports as accepted until their date, one per line <CVE or check> | <until> | <responsible> | <reason>), the field "Availability target" (iac_slo, group "compliance": 99.0, 99.5 or 99.9 %, default 99.5 – iac-compliance rates the availability of the server over 28 days against it), the platforms of the guest OSes (iac-core os.json, e.g. "Debian 13", "Home Assistant OS" – iac-provisioner sets them on the VMs) and the config context profile iac, which checks iac.guest (settings and firewall) when a config context is saved. The validator also checks the fields Settings and Firewall of a VM: their format, settings the app or a module knows, no secrets, SSH not closed – and the format of Accepted risks. A custom validator refuses an app or a module that does not exist for the chosen type (e.g. the AI workstation as LXC) when a VM is saved, and Modules, Settings or Firewall of an app whose guest OS iac does not configure inside (e.g. Home Assistant OS, os.json of iac-core); the choices show the platforms, e.g. "AI-Workstation (VM)". Choose it at creation (var_modules=provisioner) or add it later:

update --add-modules provisioner

Removing the module keeps the schema – deleting the custom fields would delete their values.

SSH button on the VM page

The schema also creates the custom link iac_ssh: a blue button "SSH" on every virtual machine with a primary IP, pointing to ssh://root@<primary IP>. New machines get it at once, there is no session list to keep up to date. Edit or disable it under Customization → Custom Links; the schema does not overwrite changes.

The browser needs a handler for ssh:// that starts PuTTY. On Windows import this once per workstation (adjust the path to putty.exe; save as .reg):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\ssh]
@="URL:SSH Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\ssh\shell\open\command]
@="powershell.exe -NoProfile -WindowStyle Hidden -Command \"& 'C:\\Program Files\\PuTTY\\putty.exe' -ssh ('%1' -replace '^ssh://','' -replace '/$','')\""

PuTTY does not take ssh:// URLs itself, so the handler turns ssh://root@192.0.2.10 into -ssh root@192.0.2.10. The browser asks once whether it may open the application.

PuTTY only talks to Pageant. If the keys live in an agent that offers the Windows OpenSSH pipe (e.g. the SSH agent of Bitwarden), bridge it once per workstation: winget install winssh-pageant.

Maintenance & Updates (inside the guest)

Fetches the latest NetBox release from GitHub, applies database migrations, runs collectstatic, and restarts services safely:

update

Self-Test (inside the guest)

Validates the Python virtualenv, Gunicorn processes, Django system health, and the RQ worker:

bash /var/lib/iac/src/core/bin/iac-smoke