Skip to content

PRD-389: Add Comprehensive Jinja2 Templates Documentation for NetBox Enterprise #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

magicalyak
Copy link
Contributor

Add Comprehensive Jinja2 Templates Documentation for NetBox Enterprise

Summary

This PR adds comprehensive documentation for Jinja2 templates in NetBox Enterprise (docs/netbox-enterprise/nbe-jinja2-templates.md), addressing customer requests for consolidated guidance on configuration automation and template usage.

Problem Statement

Customers have repeatedly requested guidance on using Jinja2 templating in NetBox to automate configuration generation. Current documentation is fragmented across OSS pages, leading to:

  • Steep learning curve for newcomers to NetBox templating
  • Insufficient coverage for real-world enterprise use cases
  • Support ticket volume from customers needing template guidance (e.g., Bank of OZK onboarding)
  • Repeated community questions across GitHub discussions and forums

This feature is critical for teams using NetBox to generate vendor-specific configs (Cisco, Juniper, etc.) or integrate with configuration management tools.

Solution

This documentation provides enterprise-focused guidance that consolidates fragmented information into a single, comprehensive resource.

Key Features

📚 Complete Coverage

  • Introduction & Context: Clear explanation of Jinja2 templates and their value in NetBox Enterprise
  • Usage Areas: Configuration rendering, export templates, webhooks, custom fields
  • Data Structure Deep Dive: Configuration contexts, rendering objects, filters, and common pitfalls

🛠️ Practical Examples

  • Step-by-Step Cisco Configuration: Complete walkthrough from context definition to validation
  • Advanced Use Cases: Nested data access, custom fields, environment segmentation
  • Real-World Scenarios: Production vs staging environments, bulk operations

🧪 Testing & Debugging

  • Local testing methods using NetBox shell_plus
  • API validation endpoints for template syntax checking
  • Common error handling with practical solutions
  • Performance optimization strategies

Customer Support

  • Comprehensive FAQ addressing common customer questions
  • Troubleshooting guide for typical issues
  • Community resources and external references

Content Structure

  1. Introduction - What & Why of Jinja2 templates
  2. Where Templates Are Used - Configuration rendering, exports, webhooks, custom fields
  3. Understanding Rendering Context - Data structures, objects, filters, pitfalls
  4. Step-by-Step Cisco Example - Complete practical walkthrough
  5. Advanced Use Cases - Loops, conditionals, nested data, custom fields
  6. Testing & Debugging - Local testing, error handling, API validation
  7. FAQs & Common Issues - Customer support scenarios
  8. Community Resources - External links, GitHub discussions, examples

Addresses Linear Ticket Requirements

Step-by-step guide for getting started with Jinja2 templates
Configuration context and data structure explanations
Popular platform examples (Cisco, with references to Juniper)
NetBox Enterprise workflows integration guidance
Template debugging and validation instructions
Community resources and external references

Referenced Issues/Discussions

  • GitHub Discussions: #17372, #12568
  • Community Support: Bank of OZK onboarding case
  • Reddit Discussions: Device roles and Jinja2 usage
  • External Resources: JPMens, HCD Consulting blog posts

Impact

This documentation will:

  • Reduce support ticket volume by providing self-service guidance
  • Accelerate customer onboarding with step-by-step examples
  • Enable advanced use cases through comprehensive coverage
  • Improve customer success with NetBox Enterprise automation features

Testing

  • ✅ Documentation builds successfully with MkDocs
  • ✅ All code examples are syntactically correct
  • ✅ External links verified and accessible
  • ✅ Formatting and structure validated

Files Changed:

  • docs/netbox-enterprise/nbe-jinja2-templates.md (new file, 547 lines)

Related:

  • Epic: PRD-389 - Add doc for getting started with Jinja templates and NetBox
  • Linear Ticket: [Customer request for Jinja2 template documentation]

@magicalyak magicalyak requested a review from richbibby June 3, 2025 14:03
@magicalyak magicalyak requested review from weyrick, RangerRick and a team as code owners June 3, 2025 14:03
@magicalyak
Copy link
Contributor Author

@richbibby can you review this for accuracy? Also maybe we want to strip out the related links at the bottom for professionalism?

@richbibby
Copy link
Contributor

a lot of the content looks solid, but I think the section 'Step-by-Step Example' needs testing and refinement. those steps don't look valid to me. I would agree with stripping out the related links at the bottom

…e - Complete guide covering templates in configuration rendering, exports, webhooks, and custom fields - Step-by-step Cisco switch configuration example with context definition and validation - Advanced use cases including nested data access, custom fields, and environment segmentation - Testing and debugging section with local testing methods and API validation - Comprehensive FAQ addressing common customer questions and troubleshooting - Community resources and external references for further learning - Addresses Linear ticket PRD-389 and customer requests for consolidated Jinja2 guidance
@magicalyak magicalyak force-pushed the PRD-389_Jinja2_Templates branch from e76af5c to 0402fab Compare June 3, 2025 15:36
@magicalyak
Copy link
Contributor Author

Needs more detail with location of files and hand-holding
Verification of Cisco step-by-step

@magicalyak magicalyak marked this pull request as draft June 4, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants