cisco.nxos.nxos_lldp_interfaces (7.0.0) — module

LLDP interfaces resource module

| "added in version" 1.0.0 of cisco.nxos"

Authors: Adharsh Srivats Rangarajan (@adharshsrivatsr)

Install collection

Install with ansible-galaxy collection install cisco.nxos:==7.0.0


Add to requirements.yml

  collections:
    - name: cisco.nxos
      version: 7.0.0

Description

This module manages interfaces' configuration for Link Layer Discovery Protocol (LLDP) on NX-OS platforms.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Using merged

# Before state:
# -------------
#

- name: Merge provided configuration with device configuration
  cisco.nxos.nxos_lldp_interfaces:
    config:
      - name: Ethernet1/4
        receive: false
        transmit: true
        tlv_set:
          management_address: 192.168.122.64
        vlan: 12
    state: merged
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# -------------
#
# interface Ethernet1/4
#   no lldp receive
#   lldp tlv-set management-address 192.168.122.64
#   lldp tlv-set vlan 12


# Using replaced

# Before state:
# ------------
#
# interface Ethernet1/4
#   no lldp receive
#   lldp tlv-set management-address 192.168.122.64
# interface Ethernet1/5
#   no lldp transmit
#   lldp tlv-set vlan 10

- name: Replace LLDP configuration on interfaces with given configuration
  cisco.nxos.nxos_lldp_interfaces:
    config:
      - name: Ethernet1/4
        transmit: false
        tlv_set:
          vlan: 2
    state: replaced
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

# After state:
# -----------
#
# interface Ethernet1/4
#   no lldp transmit
#   lldp tlv_set vlan 2
# interface Ethernet1/5
#   no lldp transmit
#   lldp tlv-set vlan 10


# Using overridden

# Before state:
# ------------
#
# interface Ethernet1/4
#   no lldp receive
#   lldp tlv-set management-address 192.168.122.64
# interface Ethernet1/5
#   no lldp transmit
#   lldp tlv-set vlan 10

- name: Override LLDP configuration on all interfaces with given configuration
  cisco.nxos.nxos_lldp_interfaces:
    config:
      - name: Ethernet1/7
        receive: false
        tlv_set:
          vlan: 12
    state: overridden
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

# After state:
# -----------
#
# interface Ethernet1/7
#   no lldp receive
#   lldp tlv_set vlan 12


# Using deleted

# Before state:
# ------------
#
# interface Ethernet1/4
#   lldp tlv-set management vlan 24
#   no lldp transmit
# interface mgmt0
#   no lldp receive

- name: Delete LLDP interfaces configuration
  cisco.nxos.nxos_lldp_interfaces:
    state: deleted

Inputs

    
state:
    choices:
    - merged
    - replaced
    - overridden
    - deleted
    - gathered
    - rendered
    - parsed
    default: merged
    description:
    - The state the configuration should be left in
    type: str

config:
    description:
    - A list of link layer discovery configurations for interfaces.
    elements: dict
    suboptions:
      name:
        description:
        - Name of the interface
        required: true
        type: str
      receive:
        description:
        - Used to enable or disable the reception of LLDP packets on that interface. By
          default, this is enabled after LLDP is enabled globally.
        type: bool
      tlv_set:
        description:
        - Used to configure TLV parameters on the interface
        suboptions:
          management_address:
            description:
            - Used to mention the IPv4 or IPv6 management address for the interface
            type: str
          vlan:
            description:
            - Used to mention the VLAN for the interface
            type: int
        type: dict
      transmit:
        description:
        - Used to enable or disable the transmission of LLDP packets on that interface.
          By default, this is enabled after LLDP is enabled globally.
        type: bool
    type: list

running_config:
    description:
    - This option is used only with state I(parsed).
    - The value of this option should be the output received from the NX-OS device by
      executing the command B(show running-config | section ^interface).
    - The state I(parsed) reads the configuration from C(running_config) option and transforms
      it into Ansible structured data as per the resource module's argspec and the value
      is then returned in the I(parsed) key within the result.
    type: str

Outputs

after:
  description: The resulting configuration model invocation.
  returned: when changed
  sample: "The configuration returned will always be in the same format\n of the parameters\
    \ above.\n"
  type: list
before:
  description: The configuration prior to the model invocation.
  returned: always
  sample: "The configuration returned will always be in the same format\n of the parameters\
    \ above.\n"
  type: list
commands:
  description: The set of commands pushed to the remote device.
  returned: always
  sample:
  - interface Ethernet1/2
  - lldp receive
  - lldp tlv-set vlan 12
  type: list