Configure JINJA_FILTERS from DataBackend #11756

Open
opened 2025-12-29 21:49:30 +01:00 by adam · 1 comment
Owner

Originally created by @anshulkamath on GitHub (Oct 21, 2025).

NetBox version

v4.4.4

Feature type

Change to existing functionality

Proposed functionality

Netbox provides the ability to enrich the Jinja execution environment with statically defined filters. This FR proposes the ability to load these filters dynamically via a DataBackend, like Git, S3, or local storage.

This ideally requires minimal lift; all that should be required is to maintain a registry of Jinja filters. The current implementation already sets the environment just-in-time for the rendering; a live registry sourced from a backend simply makes this dynamic.

Use case

This feature allows Netbox users to quickly write powerful configuration templates. Currently, a restart is required to render a template with a new filter. This significantly slows down iteration loops and is an obstacle to leveraging the data model to write rich, concise, device configurations.

Database changes

There should be no changes to the data model. All that is required is the ability to pull from a backend and load a refresh a live registry. These primitives should already be implemented for things like custom scripts.

External dependencies

As stated above, these primitives should already be implemented via the DataBackend.

Originally created by @anshulkamath on GitHub (Oct 21, 2025). ### NetBox version v4.4.4 ### Feature type Change to existing functionality ### Proposed functionality Netbox provides the ability to enrich the Jinja execution environment with [statically defined filters](https://github.com/netbox-community/netbox/blob/main/netbox/utilities/jinja2.py#L69). This FR proposes the ability to load these filters dynamically via a DataBackend, like Git, S3, or local storage. This ideally requires minimal lift; all that _should_ be required is to maintain a registry of Jinja filters. The current implementation already sets the environment just-in-time for the rendering; a live registry sourced from a backend simply makes this dynamic. ### Use case This feature allows Netbox users to quickly write powerful configuration templates. Currently, a restart is required to render a template with a new filter. This significantly slows down iteration loops and is an obstacle to leveraging the data model to write rich, concise, device configurations. ### Database changes There should be no changes to the data model. All that is required is the ability to pull from a backend and load a refresh a live registry. These primitives should already be implemented for things like custom scripts. ### External dependencies As stated above, these primitives should already be implemented via the `DataBackend`.
adam added the type: featurestatus: under review labels 2025-12-29 21:49:30 +01:00
Author
Owner

@arthanson commented on GitHub (Oct 23, 2025):

Upon initial review this doesn't seem feasible, but we will look into it further.

@arthanson commented on GitHub (Oct 23, 2025): Upon initial review this doesn't seem feasible, but we will look into it further.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11756