24 lines
549 B
YAML
24 lines
549 B
YAML
# netbox_inventory.yml
|
|||
|
|
plugin: netbox.netbox.nb_inventory
|
||
|
|
|
||
|
|
api_endpoint: https://your-netbox-url
|
||
|
|
token: your_netbox_api_token
|
||
|
|
|
||
|
|
# Disable physical devices entirely
|
||
|
|
fetch_all: false
|
||
|
|
device_query_filters:
|
||
|
|
- status: "__SKIP__" # trick to return nothing for devices
|
||
|
|
|
||
|
|
# Only pull VMs
|
||
|
|
virtual_machines_filters:
|
||
|
|
- status: active
|
||
|
|
- cluster_id: 1 # optional: filter to a specific cluster ID
|
||
|
|
|
||
|
|
group_by:
|
||
|
|
- cluster
|
||
|
|
- cluster_type
|
||
|
|
- site
|
||
|
|
- platform
|
||
|
|
|
||
|
|
compose:
|
||
|
|
ansible_host: "primary_ip4.address | ansible.utils.ipaddr('address')"
|