cisco.ios.ios_lacp module – Resource module to configure LACP.
Note
This module is part of the cisco.ios collection (version 3.3.2).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install cisco.ios
.
To use it in a playbook, specify: cisco.ios.ios_lacp
.
New in cisco.ios 1.0.0
Synopsis
This module provides declarative management of Global LACP on Cisco IOS network devices.
Parameters
Parameter |
Comments |
---|---|
The provided configurations. |
|
This option sets the default system parameters for LACP. |
|
LACP priority for the system. Refer to vendor documentation for valid values. |
|
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 |
|
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 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 Choices:
|
Notes
Note
Tested against Cisco IOSv Version 15.2 on VIRL.
This module works with connection
network_cli
. See https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html
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 |
Description |
---|---|
The configuration as structured data after module completion. Returned: when changed Sample: |
|
The configuration as structured data prior to module invocation. Returned: always Sample: |
|
The set of commands pushed to the remote device. Returned: always Sample: |