community / community.general / 1.3.14 / module / lldp get details reported by lldp Authors: Andy Hill (@andyhky)community.general.lldp (1.3.14) — module
Install with ansible-galaxy collection install community.general:==1.3.14
collections: - name: community.general version: 1.3.14
Reads data out of lldpctl
# Retrieve switch/port information - name: Gather information from lldp community.general.lldp:
- name: Print each switch/port ansible.builtin.debug: msg: "{{ lldp[item]['chassis']['name'] }} / {{ lldp[item]['port']['ifname'] }}" with_items: "{{ lldp.keys() }}"