cisco.aci.interface_range lookup – query interfaces from a range or comma separated list of ranges

Note

This lookup plugin is part of the cisco.aci collection (version 2.6.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install cisco.aci.

To use it in a playbook, specify: cisco.aci.interface_range.

Synopsis

  • this lookup returns interfaces from a range or comma separated list of ranges given to it

Terms

Parameter

Comments

Terms

string / required

comma separated strings of interface ranges

Notes

Note

  • duplicate interfaces from overlapping ranges will only be returned once

Examples

- name: "loop through range of interfaces"
  ansible.builtin.debug:
    msg: "{{ item }}"
  with_items: "{{ query('cisco.aci.interface_range', '1/1-4,1/20-25', '1/5', '1/2/3/8-10', '5/0-2') }}"

Return Value

Key

Description

Return value

list / elements=string

list of interfaces

Returned: success

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.