[PR #11769] [MERGED] Closes #11559: Implement config template rendering #13840

Closed
opened 2025-12-29 23:21:06 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/11769
Author: @jeremystretch
Created: 2/16/2023
Status: Merged
Merged: 2/17/2023
Merged by: @jeremystretch

Base: featureHead: 11559-config-templates


📝 Commits (10+)

  • f5e09c6 WIP
  • 8681e6d Add config_template field to Device
  • adaeedd Pre-fetch referenced templates
  • 72536d2 Correct up_to_date callable
  • 15be44d Add config_template FK to Device
  • 73e18f2 Update & merge migrations
  • 3d5b16b Add config_template FK to Platform
  • f92e39b Add tagging support for ConfigTemplate
  • aa64400 Catch exceptions when rendering device templates in UI
  • 74d6db9 Refactor ConfigTemplate.render()

📊 Changes

45 files changed (+886 additions, -36 deletions)

View changed files

docs/features/configuration-rendering.md (+38 -0)
📝 docs/features/context-data.md (+2 -0)
📝 docs/models/dcim/device.md (+4 -0)
📝 docs/models/dcim/devicerole.md (+4 -0)
📝 docs/models/dcim/platform.md (+4 -0)
docs/models/extras/configtemplate.md (+29 -0)
📝 mkdocs.yml (+2 -0)
📝 netbox/dcim/api/serializers.py (+7 -5)
📝 netbox/dcim/api/views.py (+2 -2)
📝 netbox/dcim/filtersets.py (+13 -0)
📝 netbox/dcim/forms/bulk_edit.py (+18 -5)
📝 netbox/dcim/forms/bulk_import.py (+24 -3)
📝 netbox/dcim/forms/filtersets.py (+17 -1)
📝 netbox/dcim/forms/model_forms.py (+18 -5)
netbox/dcim/migrations/0170_configtemplate.py (+28 -0)
📝 netbox/dcim/models/devices.py (+32 -0)
📝 netbox/dcim/tables/devices.py (+14 -5)
📝 netbox/dcim/views.py (+38 -2)
📝 netbox/extras/api/nested_serializers.py (+9 -0)
📝 netbox/extras/api/serializers.py (+23 -0)

...and 25 more files

📄 Description

Fixes: #11559

  • Introduce a new ConfigTemplate model under extras
  • Add ForeignKeys on Device, DeviceRole, and Platform referencing ConfigTemplate
  • Add DeviceRenderConfigView to display rendered configs in the UI
  • Add a /render/ REST API endpoint to render ConfigTemplates

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/11769 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 2/16/2023 **Status:** ✅ Merged **Merged:** 2/17/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `11559-config-templates` --- ### 📝 Commits (10+) - [`f5e09c6`](https://github.com/netbox-community/netbox/commit/f5e09c6f48c7acd8b29a17178430d46418c8f11d) WIP - [`8681e6d`](https://github.com/netbox-community/netbox/commit/8681e6d8230355b22214f0840c5b20db22c26f61) Add config_template field to Device - [`adaeedd`](https://github.com/netbox-community/netbox/commit/adaeedd6a27700c943114463fe222b6c5d26bed2) Pre-fetch referenced templates - [`72536d2`](https://github.com/netbox-community/netbox/commit/72536d28a77084b00c0ec282173f6834c16fbb42) Correct up_to_date callable - [`15be44d`](https://github.com/netbox-community/netbox/commit/15be44d06b2ce546d924c4202b084424428b0fb6) Add config_template FK to Device - [`73e18f2`](https://github.com/netbox-community/netbox/commit/73e18f26b33a542e2901f1bf2376cdc38255dc0a) Update & merge migrations - [`3d5b16b`](https://github.com/netbox-community/netbox/commit/3d5b16b6770f052da1e92e3f0af844e0c7196ffb) Add config_template FK to Platform - [`f92e39b`](https://github.com/netbox-community/netbox/commit/f92e39b2c9c02de3b6cf40151b4cf8aa76891237) Add tagging support for ConfigTemplate - [`aa64400`](https://github.com/netbox-community/netbox/commit/aa6440014abf36769da17866cffa4bcf1ca24a3e) Catch exceptions when rendering device templates in UI - [`74d6db9`](https://github.com/netbox-community/netbox/commit/74d6db9319215ee8e38f7014f2addad79b47eb6f) Refactor ConfigTemplate.render() ### 📊 Changes **45 files changed** (+886 additions, -36 deletions) <details> <summary>View changed files</summary> ➕ `docs/features/configuration-rendering.md` (+38 -0) 📝 `docs/features/context-data.md` (+2 -0) 📝 `docs/models/dcim/device.md` (+4 -0) 📝 `docs/models/dcim/devicerole.md` (+4 -0) 📝 `docs/models/dcim/platform.md` (+4 -0) ➕ `docs/models/extras/configtemplate.md` (+29 -0) 📝 `mkdocs.yml` (+2 -0) 📝 `netbox/dcim/api/serializers.py` (+7 -5) 📝 `netbox/dcim/api/views.py` (+2 -2) 📝 `netbox/dcim/filtersets.py` (+13 -0) 📝 `netbox/dcim/forms/bulk_edit.py` (+18 -5) 📝 `netbox/dcim/forms/bulk_import.py` (+24 -3) 📝 `netbox/dcim/forms/filtersets.py` (+17 -1) 📝 `netbox/dcim/forms/model_forms.py` (+18 -5) ➕ `netbox/dcim/migrations/0170_configtemplate.py` (+28 -0) 📝 `netbox/dcim/models/devices.py` (+32 -0) 📝 `netbox/dcim/tables/devices.py` (+14 -5) 📝 `netbox/dcim/views.py` (+38 -2) 📝 `netbox/extras/api/nested_serializers.py` (+9 -0) 📝 `netbox/extras/api/serializers.py` (+23 -0) _...and 25 more files_ </details> ### 📄 Description ### Fixes: #11559 - Introduce a new `ConfigTemplate` model under extras - Add ForeignKeys on `Device`, `DeviceRole`, and `Platform` referencing `ConfigTemplate` - Add `DeviceRenderConfigView` to display rendered configs in the UI - Add a `/render/` REST API endpoint to render ConfigTemplates --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 23:21:06 +01:00
adam closed this issue 2025-12-29 23:21:06 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13840