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.8).
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. |
Keyword parameters
This describes keyword parameters of the lookup. These are the values key1=value1
, key2=value2
and so on in the following
examples: lookup('community_fabric.ansible.table_info', key1=value1, key2=value2, ...)
and query('community_fabric.ansible.table_info', key1=value1, key2=value2, ...)
Parameter |
Comments |
---|---|
IP Fabric API token to be able to gather device information. 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. |
|
Allows connection when SSL certificates are not valid. Set to Choices:
|
Notes
Note
When keyword and positional parameters are used together, positional parameters must be listed before keyword parameters:
lookup('community_fabric.ansible.table_info', term1, term2, key1=value1, key2=value2)
andquery('community_fabric.ansible.table_info', term1, term2, key1=value1, key2=value2)
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>/', auth='<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 |