Speed Up Ansible`s NetBox Inventory

Speed Up Ansible`s NetBox Inventory

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: True
cache_plugin: jsonfile
cache_timeout: 3600
cache_connection: /tmp/ansible_netbox_cache

# Disable unused extra lookups
interfaces: False
services: False
dns_name: False
virtual_chassis_flatten: False

# Fetch all pages in one go to reduce round trips
fetch_all: True
max_uri_length: 4000

Subscribe to our newsletter and stay updated.

Don't miss anything. Get all the latest posts delivered straight to your inbox.
Great! Check your inbox and click the link to confirm your subscription.
Error! Please enter a valid email address!