DeviceType - Add ConfigTemplate field #11418

Closed
opened 2025-12-29 21:45:00 +01:00 by adam · 3 comments
Owner

Originally created by @zndrr on GitHub (Jul 26, 2025).

NetBox version

v4.3.4

Feature type

New functionality

Proposed functionality

Add a Config Template field to the DeviceType model, similar to the fields present on Device, Platform and DeviceRole. Devices will be able to render contents.

Use case

Currently you can reference a template on the Device, but it would be advantageous to be able to apply one against the Device's model, to be inherited using the same mechanisms.

For those with model-specific templates, this means you can directly reference those on the DeviceType.
For me in particular, this would allow better recyclng existing external templates with very little adjustment to be compatible with both NetBox and external platforms.

It also means not having to load an abstract base template against the Platform or Role, which then includes the relevant model base.

This will likely mean adjustment for template inheritence on a Device. Not sure the order of preference, but perhaps Device -> Platform -> Role -> DeviceType ?

Database changes

  • Additional table column for config_template on DeviceType.
  • Potential constraints? Unsure at this stage, but if there are considerations like default_platform on the DeviceType, vs platform on Device... perhaps the column becomes default_config_template on the DeviceType?

External dependencies

None

Originally created by @zndrr on GitHub (Jul 26, 2025). ### NetBox version v4.3.4 ### Feature type New functionality ### Proposed functionality Add a Config Template field to the DeviceType model, similar to the fields present on Device, Platform and DeviceRole. Devices will be able to render contents. ### Use case Currently you can reference a template on the Device, but it would be advantageous to be able to apply one against the Device's model, to be inherited using the same mechanisms. For those with model-specific templates, this means you can directly reference those on the DeviceType. For me in particular, this would allow better recyclng existing external templates with very little adjustment to be compatible with both NetBox and external platforms. It also means not having to load an abstract base template against the Platform or Role, which then includes the relevant model base. This will likely mean adjustment for template inheritence on a Device. Not sure the order of preference, but perhaps Device -> Platform -> Role -> DeviceType ? ### Database changes - Additional table column for config_template on DeviceType. - Potential constraints? Unsure at this stage, but if there are considerations like default_platform on the DeviceType, vs platform on Device... perhaps the column becomes default_config_template on the DeviceType? ### External dependencies None
adam added the type: featurestatus: under review labels 2025-12-29 21:45:00 +01:00
adam closed this issue 2025-12-29 21:45:00 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 29, 2025):

The config template should be determined by the assigned role, not by the hardware type, as a given device can typically serve multiple roles.

@jeremystretch commented on GitHub (Jul 29, 2025): The config template should be determined by the assigned role, not by the hardware type, as a given device can typically serve multiple roles.
Author
Owner

@zndrr commented on GitHub (Jul 30, 2025):

Thanks for the response.

We use roles to classify the device relative to a service type sold, e.g. Internet Firewall Primary, or WAN Router Secondary, etc.
Then we have config contexts applied against said roles for minutia like tacacs hosts, snmp, etc.

The base templates are still a model (or family) specific base for us, as there isn't enough config variation between those roles to justify a role-first approach. Multi-vendor as well.

Model-specific templates have been the most common occurrence of templates that I've seen in the ISP space where I'm from. Perhaps not as common as I thought though?

Given that you can apply a template to a device directly already, is enabling the same approach from the model infeasible?

@zndrr commented on GitHub (Jul 30, 2025): Thanks for the response. We use roles to classify the device relative to a service type sold, e.g. Internet Firewall Primary, or WAN Router Secondary, etc. Then we have config contexts applied against said roles for minutia like tacacs hosts, snmp, etc. The base templates are still a model (or family) specific base for us, as there isn't enough config variation between those roles to justify a role-first approach. Multi-vendor as well. Model-specific templates have been the most common occurrence of templates that I've seen in the ISP space where I'm from. Perhaps not as common as I thought though? Given that you can apply a template to a device directly already, is enabling the same approach from the model infeasible?
Author
Owner

@arthanson commented on GitHub (Jul 31, 2025):

Closing for reasons stated above in Jeremy's comment.

@arthanson commented on GitHub (Jul 31, 2025): Closing for reasons stated above in Jeremy's comment.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11418