# NetBox

Published articles for NetBox.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Automatically Archive Old NetBox Branches

DevFeed: [Automatically Archive Old NetBox Branches](<https://devfeed.tech/articles/automatically-archive-old-netbox-branches-30852.md>)

Original publisher: [Read original article](<https://www.packetcoders.io/automatically-archive-old-netbox-branches/>)

Author: Rick Donato

Published: 2026-08-14T08:00:15Z

Content type: release

Language: en

Sources: [Packet Coders - Learn Network Automation](<https://devfeed.tech/sources/packet-coders-learn-network-automation.md>)

Topics: [NetBox](<https://devfeed.tech/topics/netbox.md>), [Job](<https://devfeed.tech/topics/job.md>), [Database](<https://devfeed.tech/topics/database.md>)

Tags: [automatically](<https://devfeed.tech/tags/automatically.md>), [daily](<https://devfeed.tech/tags/daily.md>), [job](<https://devfeed.tech/tags/job.md>), [netbox](<https://devfeed.tech/tags/netbox.md>), [reduce](<https://devfeed.tech/tags/reduce.md>), [release](<https://devfeed.tech/tags/release.md>), [tips](<https://devfeed.tech/tags/tips.md>)

### AI overview

NetBox Branching v1.1.2 introduces the auto_archive_days setting, which runs a daily background job to archive merged branches older than a specified number of days. Automatic archival is disabled by default, and archived branches cannot be reverted.

### Source excerpt

A common question we get from students using NetBox Branching is: How can I automatically remove stale branches from NetBox? Therefore, I thought I'd share the latest addition to NetBox Branching, introduced in v1.1.2. This release adds the auto_archive_days setting, allowing you to automatically

## NetBox: How to Prevent Direct Changes to the Main Branch

DevFeed: [NetBox: How to Prevent Direct Changes to the Main Branch](<https://devfeed.tech/articles/netbox-how-to-prevent-direct-changes-to-the-main-branch-30859.md>)

Original publisher: [Read original article](<https://www.packetcoders.io/netbox-how-to-prevent-direct-changes-to-main/>)

Author: Rick Donato

Published: 2026-07-17T12:51:04Z

Content type: tutorial

Language: en

Sources: [Packet Coders - Learn Network Automation](<https://devfeed.tech/sources/packet-coders-learn-network-automation.md>)

Topics: [NetBox](<https://devfeed.tech/topics/netbox.md>), [configuration](<https://devfeed.tech/topics/configuration.md>)

Tags: [configuration](<https://devfeed.tech/tags/configuration.md>), [example](<https://devfeed.tech/tags/example.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [netbox](<https://devfeed.tech/tags/netbox.md>), [plugin](<https://devfeed.tech/tags/plugin.md>), [tips](<https://devfeed.tech/tags/tips.md>)

### AI overview

This tutorial explains how to use the NetBox Changes plugin to prevent direct changes to the main branch. It describes enabling protect_main so changes use branches and an approval workflow, and provides a configuration example.

### Source excerpt

NetBox Tip! Prevent direct changes to the main branch when using the NetBox Changes plugin. Enable protect_main to ensure all changes are made through branches and follow an approval workflow. Here's an example configuration: # ./configuration.py PLUGINS_CONFIG = { "netbox_changes": { "protect_main": True,

## How to Dynamically Create MCP Servers with FastMCP

DevFeed: [How to Dynamically Create MCP Servers with FastMCP](<https://devfeed.tech/articles/how-to-dynamically-create-mcp-servers-with-fastmcp-30853.md>)

Original publisher: [Read original article](<https://www.packetcoders.io/how-to-dynamically-create-mcp-servers-with-fastmcp-2/>)

Author: Rick Donato

Published: 2026-07-03T08:00:52Z

Content type: tutorial

Language: en

Sources: [Packet Coders - Learn Network Automation](<https://devfeed.tech/sources/packet-coders-learn-network-automation.md>)

Topics: [Model Context Protocol](<https://devfeed.tech/topics/model-context-protocol.md>), [REST API](<https://devfeed.tech/topics/rest-api.md>), [NetBox](<https://devfeed.tech/topics/netbox.md>), [OpenAPI Specification](<https://devfeed.tech/topics/openapi.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [Server](<https://devfeed.tech/topics/server.md>)

Tags: [caching](<https://devfeed.tech/tags/caching.md>), [delete](<https://devfeed.tech/tags/delete.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [llms](<https://devfeed.tech/tags/llms.md>), [mcp](<https://devfeed.tech/tags/mcp.md>), [netbox](<https://devfeed.tech/tags/netbox.md>), [openapi](<https://devfeed.tech/tags/openapi.md>), [rest-api](<https://devfeed.tech/tags/rest-api.md>), [servers](<https://devfeed.tech/tags/servers.md>), [tips](<https://devfeed.tech/tags/tips.md>)

### AI overview

A tutorial showing how to dynamically create MCP servers with FastMCP by passing a REST API's OpenAPI schema to a function. Its example builds a NetBox MCP with read/write access, excludes DELETE endpoints, and caches the schema.

### Source excerpt

MCP has gained a huge amount of popularity. And for good reason, it's easy to use and can allow you to really harness the benefits of LLMs. So here's a quick MCP tip! Dynamically create MCP servers with FastMCP by passing a REST API's

## From Intent to Reality: Driving pyATS Tests from NetBox Against a CML2 Fabric

DevFeed: [From Intent to Reality: Driving pyATS Tests from NetBox Against a CML2 Fabric](<https://devfeed.tech/articles/from-intent-to-reality-driving-pyats-tests-from-netbox-against-a-cml2-fabric-30871.md>)

Original publisher: [Read original article](<https://brent.leekley.me/blog/netbox-intent/>)

Author: Brent Leekley

Published: 2026-06-15T00:00:00Z

Content type: tutorial

Language: en

Sources: [brent.leekley.me blog](<https://devfeed.tech/sources/brent-leekley-me-blog.md>)

Topics: [NetBox](<https://devfeed.tech/topics/netbox.md>), [Network](<https://devfeed.tech/topics/network.md>), [Cisco](<https://devfeed.tech/topics/cisco.md>), [data](<https://devfeed.tech/topics/data.md>), [Structured-data](<https://devfeed.tech/topics/structured-data.md>)

Tags: [cisco-modeling-labs](<https://devfeed.tech/tags/cisco-modeling-labs.md>), [cml](<https://devfeed.tech/tags/cml.md>), [cml2](<https://devfeed.tech/tags/cml2.md>), [custom-fields](<https://devfeed.tech/tags/custom-fields.md>), [genie](<https://devfeed.tech/tags/genie.md>), [ids](<https://devfeed.tech/tags/ids.md>), [intent-based-networking](<https://devfeed.tech/tags/intent-based-networking.md>), [netbox](<https://devfeed.tech/tags/netbox.md>), [network](<https://devfeed.tech/tags/network.md>), [network-automation](<https://devfeed.tech/tags/network-automation.md>), [network-testing](<https://devfeed.tech/tags/network-testing.md>), [ospf](<https://devfeed.tech/tags/ospf.md>), [pyats](<https://devfeed.tech/tags/pyats.md>), [pynetbox](<https://devfeed.tech/tags/pynetbox.md>), [router-id](<https://devfeed.tech/tags/router-id.md>), [source-of-truth](<https://devfeed.tech/tags/source-of-truth.md>), [spine-leaf](<https://devfeed.tech/tags/spine-leaf.md>), [structured](<https://devfeed.tech/tags/structured.md>), [testbed](<https://devfeed.tech/tags/testbed.md>)

### AI overview

This tutorial shows how to store declared OSPF router-IDs in NetBox and use Cisco pyATS to compare them with the router-IDs on a live CML2 spine-leaf fabric. The comparison turns network intent validation into a pass-or-fail test.

### Source excerpt

NetBox holds the intent (declared OSPF router-IDs), a CML2 spine-leaf is the network under test, and pyATS is the judge. Close the loop and prove the live network matches what you said it should be, with real pass and fail output.

## Using Authentication Credentials within NetBox Webhooks

DevFeed: [Using Authentication Credentials within NetBox Webhooks](<https://devfeed.tech/articles/using-authentication-credentials-within-netbox-webhooks-30864.md>)

Original publisher: [Read original article](<https://www.packetcoders.io/using-authentication-credentials-within-netbox-webhooks/>)

Author: Rick Donato

Published: 2026-05-19T10:30:32Z

Content type: tutorial

Language: en

Sources: [Packet Coders - Learn Network Automation](<https://devfeed.tech/sources/packet-coders-learn-network-automation.md>)

Topics: [NetBox](<https://devfeed.tech/topics/netbox.md>), [Authentication](<https://devfeed.tech/topics/authentication.md>), [Environment Variables](<https://devfeed.tech/topics/environment-variables.md>), [configuration](<https://devfeed.tech/topics/configuration.md>)

Tags: [authentication](<https://devfeed.tech/tags/authentication.md>), [blog](<https://devfeed.tech/tags/blog.md>), [ci-cd](<https://devfeed.tech/tags/ci-cd.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [credentials](<https://devfeed.tech/tags/credentials.md>), [docker](<https://devfeed.tech/tags/docker.md>), [environment-variables](<https://devfeed.tech/tags/environment-variables.md>), [kubernetes](<https://devfeed.tech/tags/kubernetes.md>), [netbox](<https://devfeed.tech/tags/netbox.md>), [webhooks](<https://devfeed.tech/tags/webhooks.md>)

### AI overview

This tutorial explains how to provide authentication credentials in NetBox webhooks without hardcoding secrets in webhook configuration. It presents a custom Jinja2 filter that exposes selected environment variables to webhook headers or bodies, with examples for self-hosted and container-based NetBox deployments.

### Source excerpt

Background A question that came up during a recent NetBox training session was: "How should authentication credentials be provided within NetBox webhooks?" For example, you may need to send a webhook from NetBox to an external system such as: CI/CD platforms internal APIs configuration management systems notification

## Speeding Up Ansible NetBox Inventory with Caching and Fewer API Lookups

DevFeed: [Speeding Up Ansible NetBox Inventory with Caching and Fewer API Lookups](<https://devfeed.tech/articles/speed-up-ansible-s-netbox-inventory-30861.md>)

Original publisher: [Read original article](<https://www.packetcoders.io/speed-up-ansible-s-netbox-inventory/>)

Author: Rick Donato

Published: 2026-05-05T09:00:12Z

Content type: tutorial

Language: en

Sources: [Packet Coders - Learn Network Automation](<https://devfeed.tech/sources/packet-coders-learn-network-automation.md>)

Topics: [Ansible](<https://devfeed.tech/topics/ansible.md>), [NetBox](<https://devfeed.tech/topics/netbox.md>), [API](<https://devfeed.tech/topics/api.md>), [Caching](<https://devfeed.tech/topics/caching.md>)

Tags: [ansible](<https://devfeed.tech/tags/ansible.md>), [api](<https://devfeed.tech/tags/api.md>), [caching](<https://devfeed.tech/tags/caching.md>), [netbox](<https://devfeed.tech/tags/netbox.md>), [tips](<https://devfeed.tech/tags/tips.md>)

### AI overview

This tip explains how to improve Ansible NetBox inventory load times by enabling caching and disabling unused extra lookups in the netbox.netbox.nb_inventory plugin. These changes reduce calls to NetBox API endpoints.

### Source excerpt

NetBox/Ansible Tip: The netbox.netbox.nb_inventory plugin pulls data from multiple NetBox API endpoints. Enable caching and disable unused extra lookups to reduce API calls and improve inventory load times. Here's what you need to add to your NetBox inventory plugin file: # Cache inventory data cache:

## NetBox Config Templates Tip: Query Objects Efficiently with .filter()

DevFeed: [NetBox Config Templates Tip: Query Objects Efficiently with .filter()](<https://devfeed.tech/articles/netbox-config-templates-tip-query-objects-efficiently-with-filter-30858.md>)

Original publisher: [Read original article](<https://www.packetcoders.io/netbox-config-templates-tip-query-objects-efficiently-with-filter/>)

Author: Rick Donato

Published: 2026-03-10T08:00:07Z

Content type: tutorial

Language: en

Sources: [Packet Coders - Learn Network Automation](<https://devfeed.tech/sources/packet-coders-learn-network-automation.md>)

Topics: [NetBox](<https://devfeed.tech/topics/netbox.md>), [Django](<https://devfeed.tech/topics/django.md>), [Object-relational mapping](<https://devfeed.tech/topics/orm.md>)

Tags: [config](<https://devfeed.tech/tags/config.md>), [django](<https://devfeed.tech/tags/django.md>), [filter](<https://devfeed.tech/tags/filter.md>), [interface](<https://devfeed.tech/tags/interface.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [netbox](<https://devfeed.tech/tags/netbox.md>), [orm](<https://devfeed.tech/tags/orm.md>), [query](<https://devfeed.tech/tags/query.md>), [templates](<https://devfeed.tech/tags/templates.md>), [tips](<https://devfeed.tech/tags/tips.md>)

### AI overview

A short tutorial showing how to use .filter() in NetBox Config Templates to query objects during lookups and conditional logic through the Django ORM QuerySet interface.

### Source excerpt

Use .filter() in Config Templates to query objects during lookups and conditional logic. This exposes the Django ORM QuerySet filter directly in your templates. Here's an example: {% for iface in device.interfaces.filter(enabled=True, name__startswith="ge-") %} interface {{ iface.name }} {% endfor %}

## How to Inject Host and Group Vars from Ansible into NetBox Config Templates

DevFeed: [How to Inject Host and Group Vars from Ansible into NetBox Config Templates](<https://devfeed.tech/articles/how-to-inject-host-and-group-vars-from-ansible-into-netbox-config-templates-30855.md>)

Original publisher: [Read original article](<https://www.packetcoders.io/how-to-inject-host-and-group-vars-from-ansible-into-netbox-config-templates/>)

Author: Rick Donato

Published: 2025-12-18T09:00:32Z

Content type: tutorial

Language: en

Sources: [Packet Coders - Learn Network Automation](<https://devfeed.tech/sources/packet-coders-learn-network-automation.md>)

Topics: [Ansible](<https://devfeed.tech/topics/ansible.md>), [NetBox](<https://devfeed.tech/topics/netbox.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [ansible](<https://devfeed.tech/tags/ansible.md>), [api](<https://devfeed.tech/tags/api.md>), [config](<https://devfeed.tech/tags/config.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [example](<https://devfeed.tech/tags/example.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [netbox](<https://devfeed.tech/tags/netbox.md>), [templates](<https://devfeed.tech/tags/templates.md>), [tips](<https://devfeed.tech/tags/tips.md>)

### AI overview

A tutorial showing how to pass Ansible group_vars and host_vars into NetBox Config Templates so the variables can be used when rendering configuration.

### Source excerpt

Ansible and NetBox Tip: Pass Ansible group_vars and host_vars into NetBox Config Templates by sending your Ansible vars, making them available directly within your Config Templates. Here is an example: # Ansible Playbook - name: Trigger NetBox to return rendered configuration ansible.builtin.uri: url: "{{ NETBOX_ENDPOINT }}/api/dcim/