question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Move most of NetBox's configuration parameters into the database

See original GitHub issue

Environment

  • Python version: 3.7.9
  • NetBox version: 2.10.5

Proposed Functionality

Currently, NetBox stores its configuration in (wait for it) configuration.py, as a set of Python variables that get loaded at start time. This FR proposes moving most of this configuration into the database, perhaps as a monolithic JSON object. Critical configuration parameters, such as database and Redis details, would stay in configuration.py.

Use Case

There are a few benefits to this approach. First, it would allow us to provide a convenient UI and API for managing configuration settings. (Arguably that could also be done with a flat file, but using the database simplifies things quite a bit.)

It would also make highly available deployments a bit easier, as the configuration would be synchronized among nodes automatically, without having to set up a separate process to replication the configuration file.

Finally, it could also afford us the ability to store configuration revisions (if we store every configuration as a snapshot). Users could easily make a change, and then revert to a previous configuration if it goes wrong.

Database Changes

We’d probably create a ConfigurationRevision class or something to that effect. It would be a standard model, but might include a bit of additional logic for managing.

External Dependencies

The django-constance library is worth checking out, though it might be overkill.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:13
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
jeremystretchcommented, Oct 19, 2021

The delineation here will be between native Django settings and configuration parameters that we’ve introduced for NetBox specifically. By moving the later out of the settings module, we’ll be able to update them dynamically without needing to restart any services.

1reaction
jeremystretchcommented, Oct 27, 2021

NetBox config revisions

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting up NetBox with a managed PostgreSQL database
REDIS specifies the configuration parameters of Redis, an in-memory key-value store required as part of the NetBox installation. For most ...
Read more >
Migration of database from server running 2.9 to server ...
Good morning, I've experienced an error migrating the DB from a server running Netbox 2.9 to a server running 2.10.
Read more >
Setting configuration options during environment creation
Open the Elastic Beanstalk console , and in the Regions list, select your AWS Region. · In the navigation pane, choose Applications. ·...
Read more >
Nautobot v1.0 - To the Core Docs!
Nautobot v1.0¶. This document describes all new features and changes in Nautobot 1.0, a divergent fork of NetBox 2.10. For the launch of...
Read more >
Migrating from NetBox - Nautobot Documentation
Refer to the configuration documentation for details on the available options. Migrate Database Contents Using nautobot-netbox-importer ¶. Due to a number of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found