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

Terms

string / required

The IP Fabric technology and table to query.

Parameters

Parameter

Comments

base_url

string

Url of the IP Fabric API

Configuration:

  • Environment variable: IPF_URL

columns

list / elements=string

Return specific columns from IP Fabric API.

filter

dictionary

Filter applied to the API call to IP Fabric.

ipf_version

string

The version of the IP Fabric REST API.

report

string

Return report information when filtering by report.

sort

dictionary

Sort IP Fabric API response.

token

string

IP Fabric API token to be able to gather device information.

Configuration:

  • Environment variable: IPF_TOKEN

verify

boolean

Allows connection when SSL certificates are not valid. Set to false when certificated are not trusted.

Choices:

  • false

  • true

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

Return value

list / elements=string

list of composed dictionaries with key and value

Returned: success

Authors

  • Alex Gittings (@minitriga)

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.