Skip to main content

Push rendered device configurations from NetBox to devices and apply them.

Project description

NetBox version Supported Versions PyPI version Ruff License CI

NetBox Config Diff Plugin

NetBox plugin for Config Diff.

  • Find diff between the rendered configuration for a device to its actual configuration, retrieved from the device itself, or stored in DataSource.
  • Push the rendered configuration from NetBox to a device and apply it.

Documentation: https://miaow2.github.io/netbox-config-diff/

About

Collecting diffs

With this plugin you can find diff between the rendered configuration for a device to its actual configuration, retrieved from the device itself, or stored in DataSource. Read about DataSources for further details.

Device configuration renders natively in NetBox. This feature was introduced in 3.5 version. NetBox Labs blog post about it.

Plugin supports a wide list of vendors (Cisco, Juniper, Huawei, MicroTik etc.) with the help of Scrapli. Read Scrapli and scrapli-community documentations to find full list of vendors.

Pushing configuration

Also you can push rendered configuration from NetBox to device and apply it.

Supported platforms:

  • arista_eos
  • cisco_iosxe
  • cisco_iosxr
  • cisco_nxos
  • juniper_junos

This is possible thanks to the scrapli_cfg. Read Scrapli documentation for more info.

Compatibility

NetBox Version Plugin Version
3.5 =>0.1.0, <=2.5.0
3.6 =>0.1.0, <=2.6.0
3.7 =>0.1.0, <=2.8.0
4.0 =>2.6.0, <=2.9.0
4.1 =>2.7.0, <=2.12.0
4.2 =>2.9.0, <=2.12.0
4.3 =>2.10.0, <=2.12.0
4.4 =>2.11.0, <=2.13.0
4.5 =>2.14.0
4.6 =>2.15.0

Installing

For adding to a NetBox Docker setup see the general instructions for using netbox-docker with plugins.

Install with pip:

pip install netbox-config-diff

Add to local_requirements.txt:

echo netbox-config-diff >> local_requirements.txt

Enable the plugin in /opt/netbox/netbox/netbox/configuration.py, or if you use netbox-docker, your /configuration/plugins.py file, and define credentials for devices connection:

PLUGINS = [
    "netbox_config_diff",
]

PLUGINS_CONFIG = {
    "netbox_config_diff": {
        "USERNAME": "foo",
        "PASSWORD": "bar",
        "AUTH_SECONDARY": "foobar",  # define here password for accessing Privileged EXEC mode, this variable is optional
        "PATH_TO_SSH_CONFIG_FILE": "/home/.ssh/config",  # define here PATH to SSH config file, it will be used for device connections, this variable is optional
    },
}

Run database migrations:

python manage.py migrate

Collect static from the plugin:

python manage.py collectstatic --noinput

Restart NetBox service:

systemctl restart netbox netbox-rq

Usage

Read this doc about collecting diffs, for configuration management read this

Video

My presention about plugin at October NetBox community call (19.10.2023, plugin version 2.0.0).

October NetBox community call

Screenshots

Compliance finished with error

Screenshot of the compliance error

Render diff between configurations

Screenshot of diff

No diff

Screenshot of the compliance ok

Configuration request

Screenshot of the CR

Completed Configuration request

Screenshot of the completed CR

Credits

Based on the NetBox plugin tutorial:

This package was created with Cookiecutter and the netbox-community/cookiecutter-netbox-plugin project template.

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

netbox_config_diff-2.15.1.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netbox_config_diff-2.15.1-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

Details for the file netbox_config_diff-2.15.1.tar.gz.

File metadata

  • Download URL: netbox_config_diff-2.15.1.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.20

File hashes

Hashes for netbox_config_diff-2.15.1.tar.gz
Algorithm Hash digest
SHA256 65125317a47364def85552652976b31dc8e74407a48a9a46c0893251a5eb5b10
MD5 3ce73ad9a9ac17bb3e106bef741f6d5b
BLAKE2b-256 702a6d4875d2cfadc1f71118ccac6498b60f9ee61c2d74cba8660422b137da12

See more details on using hashes here.

File details

Details for the file netbox_config_diff-2.15.1-py3-none-any.whl.

File metadata

File hashes

Hashes for netbox_config_diff-2.15.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e9a48625583c8d19530a88406e0f2e1853aec2d007f49ed3fa24ae94952016fe
MD5 dd159655ee9c96d14010208c79baa8bc
BLAKE2b-256 a04b249e4ec896fa30e8f956119685095090e7dda1632efefef869139c92ca39

See more details on using hashes here.

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