community.general.lldp (8.5.0) — module

Get details reported by lldp

Authors: Andy Hill (@andyhky)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Reads data out of lldpctl


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Retrieve switch/port information
 - name: Gather information from lldp
   community.general.lldp:
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
 - name: Print each switch/port
   ansible.builtin.debug:
    msg: "{{ lldp[item]['chassis']['name'] }} / {{ lldp[item]['port']['ifname'] }}"
   with_items: "{{ lldp.keys() }}"