cisco.nxos.nxos_lacp (7.0.0) — module

LACP resource module

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

Authors: Trishna Guha (@trishnaguha)

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 Global Link Aggregation Control Protocol (LACP) on NX-OS devices.

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_lacp:
    config:
      system:
        priority: 10
        mac:
          address: 00c1.4c00.bd15
    state: merged
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# ------------
#
# lacp system-priority 10
# lacp system-mac 00c1.4c00.bd15


# Using replaced

# Before state:
# -------------
#
# lacp system-priority 10

- name: Replace device global lacp configuration with the given configuration.
  cisco.nxos.nxos_lacp:
    config:
      system:
        mac:
          address: 00c1.4c00.bd15
    state: replaced
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# ------------
#
# lacp system-mac 00c1.4c00.bd15


# Using deleted

# Before state:
# -------------
#
# lacp system-priority 10

- name: Delete global LACP configurations.
  cisco.nxos.nxos_lacp:
    state: deleted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# ------------
#

# Using rendered

- name: Render platform specific configuration lines (without connecting to the device)
  cisco.nxos.nxos_lacp:
    config:
      system:
        priority: 10
        mac:
          address: 00c1.4c00.bd15
          role: secondary
    state: rendered
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Task Output (redacted)
# -----------------------

# rendered:
#   - "lacp system-priority 10"
#   - "lacp system-mac 00c1.4c00.bd15 role secondary"

# Using parsed

# parsed.cfg
# ------------
# lacp system-priority 10
# lacp system-mac 00c1.4c00.bd15 role secondary

- name: Use parsed state to convert externally supplied config to structured format
  cisco.nxos.nxos_lacp:
    running_config: "{{ lookup('file', 'parsed.cfg') }}"
    state: parsed
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Task output (redacted)
# -----------------------
# parsed:
#  system:
#    priority: 10
#    mac:
#      address: 00c1.4c00.bd15
#      role: secondary

# Using gathered

# Existing device config state
# -------------------------------
# Nexus9000v# show running-config | include lacp
# lacp system-priority 11
# lacp system-mac 00c1.4c00.bd15 role primary

- name: Gather lacp facts from the device using nxos_lacp
  cisco.nxos.nxos_lacp:
    state: gathered

Inputs

    
state:
    choices:
    - merged
    - replaced
    - overridden
    - deleted
    - gathered
    - rendered
    - parsed
    default: merged
    description:
    - The state of the configuration after module completion.
    - States C(replaced) and C(overridden) have the same behaviour for this module.
    type: str

config:
    description: LACP global options.
    suboptions:
      system:
        description:
        - LACP system options
        suboptions:
          mac:
            description:
            - MAC address to be used for the LACP Protocol exchanges
            suboptions:
              address:
                description:
                - MAC-address (FORMAT :xxxx.xxxx.xxxx).
                type: str
              role:
                choices:
                - primary
                - secondary
                description:
                - The role for the Switch.
                type: str
            type: dict
          priority:
            description:
            - The system priority to use in LACP negotiations.
            type: int
        type: dict
    type: dict

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 | include lacp).
    - 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 configuration as structured data after module completion.
  returned: when changed
  sample: "The configuration returned will always be in the same format\n of the parameters\
    \ above.\n"
  type: dict
before:
  description: The configuration as structured data prior to module invocation.
  returned: always
  sample: "The configuration returned will always be in the same format\n of the parameters\
    \ above.\n"
  type: dict
commands:
  description: The set of commands pushed to the remote device.
  returned: always
  sample:
  - lacp system-priority 15
  - lacp system-mac 00c1.4c00.bd15 role primary
  type: list