Assign Config Context by module type installed #11309

Closed
opened 2025-12-29 21:43:23 +01:00 by adam · 1 comment
Owner

Originally created by @alehaa on GitHub (Jun 23, 2025).

NetBox version

v4.3.2

Feature type

Data model extension

Proposed functionality

For the ConfigContext model, a new field should be added to enable filtering for installed module types. If this field is set, the configuration context should only be applied when a module of that type is installed on the device.

Use case

Some configurations may depend on the modules installed in the device. For instance, Cisco switches have features that depend on the supervisor module installed, which in turn affects the configurations applied to the device (e.g., through config context).

Database changes

A new field needs to be added to the ConfigContext model.

External dependencies

None.

Originally created by @alehaa on GitHub (Jun 23, 2025). ### NetBox version v4.3.2 ### Feature type Data model extension ### Proposed functionality For the `ConfigContext` model, a new field should be added to enable filtering for installed module types. If this field is set, the configuration context should only be applied when a module of that type is installed on the device. ### Use case Some configurations may depend on the modules installed in the device. For instance, Cisco switches have features that depend on the supervisor module installed, which in turn affects the configurations applied to the device (e.g., through config context). ### Database changes A new field needs to be added to the `ConfigContext` model. ### External dependencies None.
adam added the type: feature label 2025-12-29 21:43:23 +01:00
adam closed this issue 2025-12-29 21:43:23 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jun 26, 2025):

Unfortunately this is probably a bridge too far where performance is concerned: The necessary queries would severely impact performance, especially for bulk queries.

Alternatively, you can create a config context that provides multiple potential values and implement logic within the template to introspect the device and select the appropriate value.

@jeremystretch commented on GitHub (Jun 26, 2025): Unfortunately this is probably a bridge too far where performance is concerned: The necessary queries would severely impact performance, especially for bulk queries. Alternatively, you can create a config context that provides multiple potential values and implement logic within the template to introspect the device and select the appropriate value.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11309