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
