Include information in netbox_inventory
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -112,3 +112,5 @@ roles/
|
||||
|
||||
.vscode/
|
||||
keys/
|
||||
collections/ansible_collections/
|
||||
.vscode/
|
||||
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@@ -1 +1,3 @@
|
||||
{}
|
||||
{
|
||||
"git.ignoreLimitWarning": true
|
||||
}
|
||||
23
netbox.yml
23
netbox.yml
@@ -1,23 +0,0 @@
|
||||
plugin: netbox
|
||||
validate_certs: False
|
||||
config_context: True
|
||||
group_by:
|
||||
- device_roles
|
||||
|
||||
#query_filters:
|
||||
# - role: core-switch
|
||||
|
||||
#query_filters:
|
||||
# - role: network-edge-router
|
||||
|
||||
# Query filters are passed directly as an argument to the fetching queries.
|
||||
# You can repeat tags in the query string.
|
||||
|
||||
#query_filters:
|
||||
# - role: server
|
||||
# - tag: web
|
||||
# - tag: production
|
||||
|
||||
#compose:
|
||||
# foo: last_updated
|
||||
# bar: display_name
|
||||
@@ -3,7 +3,17 @@ plugin: netbox.netbox.nb_inventory
|
||||
api_endpoint: http://netbox.mgmt.toal.ca
|
||||
validate_certs: True
|
||||
config_context: True
|
||||
interfaces: True
|
||||
services: True
|
||||
plurals: False
|
||||
|
||||
group_by:
|
||||
- device_roles
|
||||
#query_filters:
|
||||
# - role: network-edge-router
|
||||
- site
|
||||
- tag
|
||||
- role
|
||||
- platform
|
||||
- cluster
|
||||
|
||||
|
||||
#query_filters:
|
||||
# - role: network-edge-router
|
||||
|
||||
23
switch_config.yml
Normal file
23
switch_config.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
- name: Collect Netbox Data
|
||||
hosts: role_core-switch
|
||||
gather_facts: false
|
||||
collections:
|
||||
- netbox.netbox
|
||||
vars:
|
||||
api_endpoint: "{{ lookup('env','NETBOX_API') }}"
|
||||
api_token: "{{ lookup('env', 'NETBOX_TOKEN') }}"
|
||||
|
||||
tasks:
|
||||
# - name: Gather Device Information
|
||||
# set_fact:
|
||||
# device_info: "{{ query('netbox.netbox.nb_lookup', 'devices', api_filter='name=' + inventory_hostname, api_endpoint=api_endpoint, token=api_token )[0] }}"
|
||||
- debug:
|
||||
var: interfaces
|
||||
|
||||
# - name: Obtain list of devices from Netbox
|
||||
# debug:
|
||||
# var: >
|
||||
# "Device {{ item.value.display_name }} (ID: {{ item.key }}) was
|
||||
# manufactured by {{ item.value.device_type.manufacturer.name }}"
|
||||
# loop: "{{ query('netbox.netbox.nb_lookup', 'devices', api_endpoint=api_endpoint, token=api_token ) }}"
|
||||
Reference in New Issue
Block a user