Skip to main content

A git-like branching implementation for NetBox

Project description

NetBox Branching

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.

Requirements

  • NetBox v4.1 or later
  • PostgreSQL 12 or later

Installation

Brief installation instructions are provided below. For a complete installation guide, please refer to the included documentation.

  1. Grant PostgreSQL permission for the NetBox database user to create schemas:
GRANT CREATE ON DATABASE $database TO $user;
  1. Activate the NetBox virtual environment:
$ source /opt/netbox/venv/bin/activate
  1. Install the plugin from PyPI:
$ pip install netboxlabs-netbox-branching
  1. Add netbox_branching to the end of PLUGINS in configuration.py. Note that netbox_branching MUST be the last plugin listed.
PLUGINS = [
    # ...
    'netbox_branching',
]
  1. Create local_settings.py (in the same directory as settings.py) to override the DATABASES & 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',
]
  1. Run NetBox migrations:
$ ./manage.py migrate

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netboxlabs-netbox-branching-0.5.3.tar.gz (33.6 kB view details)

Uploaded Source

File details

Details for the file netboxlabs-netbox-branching-0.5.3.tar.gz.

File metadata

File hashes

Hashes for netboxlabs-netbox-branching-0.5.3.tar.gz
Algorithm Hash digest
SHA256 3a39b3a57f852cb90f8d3b741c0a21f4ebdf81d93e8635c9cd01e51aaa3a5009
MD5 e1423beb137422741c091dfb19c3391f
BLAKE2b-256 bf698e91e58513a5b00008f8e86a2a6c55af3debf4e1dfe47b8d92c6b406a0f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for netboxlabs-netbox-branching-0.5.3.tar.gz:

Publisher: release.yaml on netboxlabs/netbox-branching

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page