This NetBox plugin introduces branching functionality. A branch is a discrete, static snapshot of the NetBox database which can be modified independently and later merged back into the main database. This enables users to make "offline" changes to objects within NetBox and avoid interfering with its integrity as the network source of truth. It also provides the opportunity to review changes in bulk prior to their application.
- NetBox v4.1 or later
- PostgreSQL 12 or later
Brief installation instructions are provided below. For a complete installation guide, please refer to the included documentation.
- Grant PostgreSQL permission for the NetBox database user to create schemas:
GRANT CREATE ON DATABASE $database TO $user;
- Activate the NetBox virtual environment:
$ source /opt/netbox/venv/bin/activate
- Install the plugin from PyPI:
$ pip install netboxlabs-netbox-branching
- Add
netbox_branching
to the end ofPLUGINS
inconfiguration.py
. Note thatnetbox_branching
MUST be the last plugin listed.
PLUGINS = [
# ...
'netbox_branching',
]
- Create
local_settings.py
(in the same directory assettings.py
) to override theDATABASES
&DATABASE_ROUTERS
settings. This enables dynamic schema support.
from netbox_branching.utilities import DynamicSchemaDict
from .configuration import DATABASE
# Wrap DATABASES with DynamicSchemaDict for dynamic schema support
DATABASES = DynamicSchemaDict({
'default': DATABASE,
})
# Employ our custom database router
DATABASE_ROUTERS = [
'netbox_branching.database.BranchAwareRouter',
]
- Run NetBox migrations:
$ ./manage.py migrate