community / community.general / 3.8.10 / module / lldp get details reported by lldp Authors: Andy Hill (@andyhky)community.general.lldp (3.8.10) — module
Install with ansible-galaxy collection install community.general:==3.8.10
collections: - name: community.general version: 3.8.10
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() }}"