community_fabric.ansible.table_info lookup – Queries and returns IP Fabric information.
Note
This lookup plugin is part of the community_fabric.ansible collection (version 0.0.4).
To install it, use: ansible-galaxy collection install community_fabric.ansible
.
You need further requirements to be able to use this lookup plugin,
see Requirements for details.
To use it in a playbook, specify: community_fabric.ansible.table_info
.
Synopsis
Queries IP Fabric via its API and returns information.
Requirements
The below requirements are needed on the local controller node that executes this lookup.
ipfabric
Terms
Parameter |
Comments |
---|---|
The IP Fabric technology and table to query. |
Parameters
Parameter |
Comments |
---|---|
Url of the IP Fabric API Configuration:
|
|
Return specific columns from IP Fabric API. |
|
Filter applied to the API call to IP Fabric. |
|
The version of the IP Fabric REST API. |
|
Return report information when filtering by report. |
|
Sort IP Fabric API response. |
|
IP Fabric API token to be able to gather device information. Configuration:
|
|
Allows connection when SSL certificates are not valid. Set to Choices:
|
Examples
- name: Get devices using lookup inventory plugin (IPF_URL and IPF_TOKEN environment variables set)
ansible.builtin.debug:
msg: "{{ lookup('community_fabric.ansible.table_info', 'inventory', 'devices') }}"
- name: Get devices using lookup inventory plugin
ansible.builtin.debug:
msg: "{{ lookup('community_fabric.ansible.table_info', 'inventory', 'devices', base_url='https://<url_here>/', token='<token_here>') }}"
- name: Get sites and sort by name.
ansible.builtin.debug:
msg: "{{ lookup('community_fabric.ansible.table_info', 'inventory', 'sites', sort={'order': 'asc', 'column': 'siteName'}) }}"
- name: Get interfaces filtered by device (if technology is not specified the default is inventory)
ansible.builtin.debug:
msg: "{{ lookup('community_fabric.ansible.table_info', 'interfaces', filter={'hostname': ['eq', 'L38AC20']}, sort={'order': 'asc', 'column':'intName'})}}"
- name: Get interface that match intent verification rule
ansible.builtin.debug:
msg: "{{ lookup('community_fabric.ansible.table_info', 'inventory', 'interfaces', filter={'duplex':['color','eq','20']}, report='/inventory/interfaces')}}"
Return Value
Key |
Description |
---|---|
list of composed dictionaries with key and value Returned: success |