cisco.ios.ios_lacp – LACP resource module

Note

This plugin is part of the cisco.ios collection (version 1.3.0).

To install it use: ansible-galaxy collection install cisco.ios.

To use it in a playbook, specify: cisco.ios.ios_lacp.

New in version 1.0.0: of cisco.ios

Synopsis

  • This module provides declarative management of Global LACP on Cisco IOS network devices.

Note

This module has a corresponding action plugin.

Parameters

Parameter Choices/Defaults Comments
config
dictionary
The provided configurations.
system
dictionary
This option sets the default system parameters for LACP.
priority
integer / required
LACP priority for the system.
Refer to vendor documentation for valid values.
running_config
string
This option is used only with state parsed.
The value of this option should be the output received from the IOS device by executing the command show lacp sys-id.
The state parsed reads the configuration from 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 parsed key within the result.
state
string
    Choices:
  • merged ←
  • replaced
  • deleted
  • rendered
  • parsed
  • gathered
The state the configuration should be left in
The states rendered, gathered and parsed does not perform any change on the device.
The state rendered will transform the configuration in config option to platform specific CLI commands which will be returned in the rendered key within the result. For state rendered active connection to remote host is not required.
The state gathered will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the gathered key within the result.
The state parsed reads the configuration from running_config option and transforms it into JSON format as per the resource module parameters and the value is returned in the parsed key within the result. The value of running_config option should be the same format as the output of command show running-config | include ip route|ipv6 route executed on device. For state parsed active connection to remote host is not required.

Notes

Note

  • Tested against Cisco IOSv Version 15.2 on VIRL.

Examples

# Using merged
#
# Before state:
# -------------
#
# vios#show lacp sys-id
# 32768, 5e00.0000.8000

- name: Merge provided configuration with device configuration
  cisco.ios.ios_lacp:
    config:
      system:
        priority: 123
    state: merged

# After state:
# ------------
#
# vios#show lacp sys-id
# 123, 5e00.0000.8000

# Using replaced
#
# Before state:
# -------------
#
# vios#show lacp sys-id
# 500, 5e00.0000.8000

- name: Replaces Global LACP configuration
  cisco.ios.ios_lacp:
    config:
      system:
        priority: 123
    state: replaced

# After state:
# ------------
#
# vios#show lacp sys-id
# 123, 5e00.0000.8000

# Using Deleted
#
# Before state:
# -------------
#
# vios#show lacp sys-id
# 500, 5e00.0000.8000

- name: Delete Global LACP attribute
  cisco.ios.ios_lacp:
    state: deleted

# After state:
# -------------
#
# vios#show lacp sys-id
# 32768, 5e00.0000.8000

# Using Gathered

# Before state:
# -------------
#
# vios#show lacp sys-id
# 123, 5e00.0000.8000

- name: Gather listed LACP with provided configurations
  cisco.ios.ios_lacp:
    config:
    state: gathered

# Module Execution Result:
# ------------------------
#
# "gathered": {
#         "system": {
#             "priority": 500
#         }
#     }

# After state:
# ------------
#
# vios#show lacp sys-id
# 123, 5e00.0000.8000

# Using Rendered

- name: Render the commands for provided  configuration
  cisco.ios.ios_lacp:
    config:
      system:
        priority: 123
    state: rendered

# Module Execution Result:
# ------------------------
#
# "rendered": [
#         "lacp system-priority 10"
#     ]

# Using Parsed

# File: parsed.cfg
# ----------------
#
# lacp system-priority 123

- name: Parse the commands for provided configuration
  cisco.ios.ios_lacp:
    running_config: "{{ lookup('file', 'parsed.cfg') }}"
    state: parsed

# Module Execution Result:
# ------------------------
#
# "parsed": {
#         "system": {
#             "priority": 123
#         }
#     }

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
after
list / elements=string
when changed
The configuration as structured data after module completion.

Sample:
The configuration returned will always be in the same format of the parameters above.
before
list / elements=string
always
The configuration as structured data prior to module invocation.

Sample:
The configuration returned will always be in the same format of the parameters above.
commands
list / elements=string
always
The set of commands pushed to the remote device.

Sample:
['lacp system-priority 10']


Authors

  • Sumit Jaiswal (@justjais)