- name: Create a list without Gigabit interfaces
set_fact:
exclude1: "{{ ex | reject('search', 'Giga') | list }}"
- name: Create a list of GigabitEthernet0/0
set_fact:
exclude2: "{{ ex | select('search', 'GigabitEthernet0/0') | list }}"
- name: Gather the Port Channel Summary
ansible.netcommon.cli_parse:
command: "show etherchannel summary"
parser:
name: ansible.netcommon.pyats
set_fact: eth_sum
- name: Get the PO Channel Interfaces
set_fact:
po_ints: "{{ eth_sum.interfaces|json_query(query)|
flatten }}"
cacheable: yes
vars:
query: '*.port_channel.port_channel_member_intfs'
- name: Create one list to be used in a future play
set_fact:
exclude_interfaces: "{{ exclude1 + exclude2 + po_ints }}"
cacheable: yes