@@ -43,7 +43,7 @@ netbox.netbox.nb_inventory inventory -- NetBox inventory source
43
43
.. Collection note
44
44
45
45
.. note ::
46
- This inventory plugin is part of the `netbox.netbox collection <https://galaxy.ansible.com/netbox/netbox >`_ (version 3.8.0 ).
46
+ This inventory plugin is part of the `netbox.netbox collection <https://galaxy.ansible.com/netbox/netbox >`_ (version 3.8.1 ).
47
47
48
48
To install it, use: :code: `ansible-galaxy collection install netbox.netbox `.
49
49
@@ -710,7 +710,9 @@ Parameters
710
710
711
711
<div class="ansible-option-cell">
712
712
713
- List of parameters passed to the query string for devices (Multiple values may be separated by commas)
713
+ List of parameters passed to the query string for devices (Multiple values may be separated by commas).
714
+
715
+ You can also use Jinja2 templates.
714
716
715
717
716
718
.. rst-class :: ansible-option-line
@@ -1086,6 +1088,8 @@ Parameters
1086
1088
- :ansible-option-choices-entry: `is\_ virtual `
1087
1089
- :ansible-option-choices-entry: `services `
1088
1090
- :ansible-option-choices-entry: `status `
1091
+ - :ansible-option-choices-entry: `time\_ zone `
1092
+ - :ansible-option-choices-entry: `utc\_ offset `
1089
1093
1090
1094
.. rst-class :: ansible-option-line
1091
1095
@@ -1836,7 +1840,9 @@ Parameters
1836
1840
1837
1841
<div class="ansible-option-cell">
1838
1842
1839
- List of parameters passed to the query string for both devices and VMs (Multiple values may be separated by commas)
1843
+ List of parameters passed to the query string for both devices and VMs (Multiple values may be separated by commas).
1844
+
1845
+ You can also use Jinja2 templates.
1840
1846
1841
1847
1842
1848
.. rst-class :: ansible-option-line
@@ -2307,7 +2313,9 @@ Parameters
2307
2313
2308
2314
<div class="ansible-option-cell">
2309
2315
2310
- List of parameters passed to the query string for VMs (Multiple values may be separated by commas)
2316
+ List of parameters passed to the query string for VMs (Multiple values may be separated by commas).
2317
+
2318
+ You can also use Jinja2 templates.
2311
2319
2312
2320
2313
2321
.. rst-class :: ansible-option-line
@@ -2349,8 +2357,11 @@ Examples
2349
2357
- role: network-edge-router
2350
2358
device_query_filters:
2351
2359
- has_primary_ip: 'true'
2360
+ - tenant__n: internal
2352
2361
2353
2362
# has_primary_ip is a useful way to filter out patch panels and other passive devices
2363
+ # Adding '__n' to a field searches for the negation of the value.
2364
+ # The above searches for devices that are NOT "tenant = internal"
2354
2365
2355
2366
# Query filters are passed directly as an argument to the fetching queries.
2356
2367
# You can repeat tags in the query string.
@@ -2406,6 +2417,32 @@ Examples
2406
2417
NETBOX_API: '{{ NETBOX_API }}'
2407
2418
NETBOX_TOKEN: '{{ NETBOX_TOKEN }}'
2408
2419
2420
+ # Example of time_zone and utc_offset usage
2421
+
2422
+ plugin: netbox.netbox.nb_inventory
2423
+ api_endpoint: http://localhost:8000
2424
+ token: <insert token>
2425
+ validate_certs: True
2426
+ config_context: True
2427
+ group_by:
2428
+ - site
2429
+ - role
2430
+ - time_zone
2431
+ - utc_offset
2432
+ device_query_filters:
2433
+ - has_primary_ip: 'true'
2434
+ - manufacturer_id: 1
2435
+
2436
+ # using group by time_zone, utc_offset it will group devices in ansible groups depending on time zone configured on site.
2437
+ # time_zone gives grouping like:
2438
+ # - "time_zone_Europe_Bucharest"
2439
+ # - "time_zone_Europe_Copenhagen"
2440
+ # - "time_zone_America_Denver"
2441
+ # utc_offset gives grouping like:
2442
+ # - "time_zone_utc_minus_7"
2443
+ # - "time_zone_utc_plus_1"
2444
+ # - "time_zone_utc_plus_10"
2445
+
2409
2446
2410
2447
2411
2448
0 commit comments